Initial Setup in Git
From the Git cheat sheet ยท Getting Started ยท verified Nov 2026
Initial Setup
Configure Git for first time use with your identity
bash
# Set user info (required for commits)
git config --global user.name "Your Name"
git config --global user.email "email@example.com"
# Set default branch name
git config --global init.defaultBranch main
# Check settings
git config --list๐ก --global applies to all your repos (~/.gitconfig)
๐ Local config overrides global settings
โก Set your editor for commit messages and conflicts
๐ Without init.defaultBranch, Git still uses master
Continue with Git
Save the full cheat sheet or work through every related task.