Git Cheatsheet
Searchable reference of Git commands: daily workflow, undo and recovery, worktrees, bisect, sparse-checkout and more
- First-time setupRequires Git 2.28+
git config --global user.name "Your Name" git config --global user.email "you@example.com" git config --global init.defaultBranch mainIdentity used for every commit, and main as the default branch name for new repositories.
Commands were checked against the Git documentation. Replace <placeholders> with your own values.