Before creating repositories or writing commits, Git must be properly installed on your operating system and configured with your identity. Every Git commit embeds the author's name and email permanently into its cryptographic hash, making initial configuration essential.
.exe installer. Recommended installation settings:main (modern standard).core.autocrlf = true).On macOS, Git can be installed via Xcode Command Line Tools or Homebrew:
Open your terminal (PowerShell, Command Prompt, macOS Terminal, or Linux Bash) and verify:
Git configurations can be applied at three different scopes:
| Scope Flag | Config File Location | Scope of Effect |
|---|---|---|
--system | /etc/gitconfig (Unix) or C:\Program Files\Git\etc\gitconfig (Windows) | Applies to every user and every repository on the operating system |
--global | ~/.gitconfig or user profile .gitconfig | Applies to the current operating system user across all their repos |
--local | .git/config inside the active repository folder | Applies only to this specific project repository |
--local overrides --global, which overrides --system.Git requires an author name and email address. These will be stamped onto every commit you ever create:
Historically Git defaulted to master. The modern industry standard adopted by GitHub, GitLab, and the Git community is main:
Configure VS Code as Git's default text editor for commit messages and interactive rebasing:
core.autocrlf)Operating systems handle line breaks differently: Windows uses CRLF (\r\n), while macOS and Linux use LF (\n). Without normalization, teams collaborating across Windows and Mac will experience phantom diffs on every line:
To review all active configuration parameters:
git config scope applies settings across all repositories for the currently logged-in user?--local setting that conflicts with a --global setting?user.name and user.email mandatory in Git?core.autocrlf = true on a Windows developer workstation?Continue learning with hands-on practice, examples, and exercises in the upcoming topic.
Test your understanding of this lesson with 5 questions. Each question has one correct answer.
Practice in live mentor-led sessions with real projects, mock tests, and verifiable certification at MSK Institute.