Git Config: How to Configure Git for Your Workflow
Before writing your first commit, Git needs to know who you are. git config controls everything from your identity to your preferred editor, merge strategy, and custom aliases. This guide covers local, global, and system-level configuration.
The Problem
Your commits show up with the wrong author name, or Git keeps opening a text editor you don't recognize. You've never configured Git and now things aren't working the way you expect.
Git's default settings are minimal by design. A few minutes of configuration — your name, email, default editor, and a handful of aliases — will save you hours of friction and make every commit properly attributed.
Common mistakes developers make with this:
Not setting user.name and user.email before making the first commit
Mixing up global and local config, ending up with the wrong email on work commits
Not knowing where the config file actually lives
Setting config values with typos that Git silently accepts
Gitoryx: Gitoryx reads your Git config automatically and displays your name and email in the commit panel — so you can verify your identity before every commit.
What is Config: How to Configure Git for Your Workflow?
`git config` reads and writes Git configuration values. Settings can be scoped to a single repository (local), your user account (global), or the entire system. Global settings live in `~/.gitconfig`.
Step-by-Step Guide
1
Set your name and email (global)
This is the first thing to do after installing Git. These values appear on every commit you make.
Use the email address associated with your GitHub/GitLab account so contributions are linked to your profile.
2
Override config for a specific repository
Omit `--global` to set a value only for the current repo. Useful when you have a work laptop but also contribute to personal projects with a different email.
bash
cd ~/work/company-project
git config user.email "jane@company.com"
3
Set your default editor
Git opens a text editor when you write multi-line commit messages or run interactive rebase. Set it to your preferred editor.
On macOS and Linux it's `~/.gitconfig`. On Windows it's usually `C:\Users\<YourName>\.gitconfig`. You can open it directly with `git config --global --edit`.
What is the difference between --global and --local config?
`--global` applies to all repositories for your user account. `--local` (the default) applies only to the current repository and is stored in `.git/config`. Local settings override global ones.
How do I check my current Git config?
Run `git config --list` to see all active settings. Add `--show-origin` to see which file each value comes from.
Can I use different emails for different projects automatically?
Yes. Use Git's `includeIf` directive in your global `~/.gitconfig` to automatically load a different config file for all repos under a specific directory path.
Everything in this tutorial is faster and clearer with a visual Git client. Gitoryx is free, runs natively on macOS, Windows, and Linux, and built for developers who want to move fast without breaking things.