Configuring Git
After installing Git, we need to introduce ourselves. Git attaches your name and email to every commit you make, so others know who did what. This is a one‑time setup.
Setting Your Username and Email
Open your terminal (Git Bash on Windows, or just Terminal on macOS/Linux). Run these commands, replacing the name and email with your own:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"These settings will be used for all your Git projects unless you override them.Checking Your Configuration
To see all your Git settings:
git config --listTo check a specific value, e.g., user name:git config user.nameSetting Your Default Editor
Git sometimes needs you to write a commit message or resolve conflicts. You can set your favorite text editor as the default. For example, to use VS Code:
git config --global core.editor "code --wait"For nano (simple terminal editor):git config --global core.editor "nano"Where Are These Settings Stored?
Git stores configuration in three levels:
- System – for all users on the machine (rarely touched).
- Global – for your user account (the one we just set).
- Local – for a single repository (overrides global).
cat ~/.gitconfigTwo Minute Drill
- Set your name and email with
git config --global user.name "Name"andgit config --global user.email "email". - Use
git config --listto view all settings. - Set your preferred text editor with
git config --global core.editor "editor". - Global settings are stored in
~/.gitconfig.
Need more clarification?
Drop us an email at career@quipoinfotech.com
