Git does a lot of heavy lifting behind the scenes, yet stays quietly out of your way. After installation, a few basic settings are all you need to get started.

Installing Git

Windows users can take the most straightforward route by downloading Git for Windows from git-scm.com. No custom options are needed — clicking "next" through the installer is enough. Git Bash, a handy terminal application, is included with the installation.

Linux users are already comfortable in the terminal. The install command varies by distribution. For Ubuntu / Debian use sudo apt install git, and for Fedora use sudo dnf install git.

macOS users can open the terminal and type git --version — if Git isn't installed, the system will prompt them to install it. That said, installing via Homebrew is the more popular choice among developers: brew install git

If git --version returns a version number in your terminal, Git is installed and ready to use.

What is Git Bash?

Installing Git on Windows also installs Git Bash, a handy terminal application. It provides a Linux/Unix-like terminal experience on Windows. Using it isn't mandatory — any terminal will work — but Git Bash is the more compatible choice. Its main advantage is that it supports Unix commands like ls, mkdir, and cat on Windows, which is exactly what the vast majority of Git documentation and online resources assume you're using.

First Steps After Installing Git

The first thing to configure after installation is your name and email address. These two pieces of information are required — they appear in every commit you make. Everything else is optional.

terminal
# Start with these two essential settings
git config --global user.name "John"
git config --global user.email "john@example.com"

Next, it's a good idea to set your default branch name. Older versions of Git defaulted to "master", while newer versions default to "main". Setting this explicitly avoids any confusion.

git config --global init.defaultBranch main

You can also set your preferred default editor:

git config --global core.editor "code --wait" (VS Code)

git config --global core.editor "vim" (Vim)

If you use a different editor, replace "code --wait" with "vim", "nano", or "notepad" as appropriate.

How to View Your Git Settings

Run git config --list to review your current settings. If your name and email look correct, you're good to go.

terminal
# View your Git settings
git config --list            # all settings
git config --global --list   # global settings only
git config user.name         # a specific setting

Where Are Git Settings Stored?

A .gitconfig file is nothing more than a plain text file. You can open and edit it with any text editor — Git config settings are stored there.

On Windows, global settings are stored at C:/Users/YourUsername/.gitconfig. On Linux and Mac, the path is ~/.gitconfig. Local settings are stored under your-project-folder/.git/config.

Level Flag Description
System git config --system Applies to all users and all repositories on the machine.
Global git config --global Applies to all repositories for the current user. This is the most commonly used level.
Local git config --local Applies only to the current repository.
If the same setting exists at both the Global and Local level, Git always uses the more specific one — Local takes precedence. The hierarchy is: Local > Global > System.

Local vs Global Configuration

Global settings apply to all Git repositories for the current user on this machine. Most developers stick with global settings exclusively — one machine, one identity. If you work alone, global is almost certainly all you need.

Local settings apply only to a specific repository. They are stored in that project's .git/config file rather than the global .gitconfig. A common use case: on the same machine, you might use john@example.com for personal projects and john@company.com for work projects.

System settings apply to every user and every repository on the machine. They're rarely touched in day-to-day use and are typically configured by system administrators in corporate environments. For example, if multiple developers share the same machine, an admin can set a proxy configuration at the system level once and it applies to everyone automatically.

To see which file each setting comes from, run git config --list --show-origin.

How to Edit and Remove Git Settings

You can update or completely remove any setting using git config.

terminal
# Examples of removing and updating Git settings

# Remove email from global config
git config --global --unset user.email

# Update global email
git config --global user.email new@example.com

# Change the default editor
git config --global core.editor "nano"

# Remove email from local config (run inside the project folder)
git config --local --unset user.email

# Check the current value of a setting before removing it
git config --global user.email