All chapters in this track
- 011. The Mental Model
- 022. Essential Setup
- 033. Core Daily Workflow
- 044. Branching
- 055. Merging & Conflict Resolution
- 066. Rebasing
- 077. Remote Repositories
- 088. Stashing
- 099. Undoing Things
- 1010. Tagging & Versioning
- 1111. Cherry-Pick
- 1212. Git Bisect & Blame
- 1313. Git Hooks
- 1414. Submodules
- 1515. Team Workflows
- 1616. Power Commands & Aliases
- 1717. Reflog: The Safety Net
- 1818. Practice Tasks
- 19Quick Reference Cheatsheet
Chapter 2 of 19
2. Essential Setup
First-time configuration
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global core.editor "code --wait" # VS Code as editor
git config --global init.defaultBranch main
git config --global pull.rebase false # merge strategy on pull (change to true for rebase)
View config
git config --list --show-origin # all settings + where they come from
git config user.name # check a single value
Initialize or clone
git init my-project # new repo
git clone <url> # copy existing repo
git clone <url> folder # clone into specific folder
.gitignore essentials
# Compiled output
*.class
*.pyc
__pycache__/
dist/
build/
# Environment & secrets
.env
*.pem
secrets.json
# Editor
.vscode/
.idea/
Generate project-specific ignore files at gitignore.io.