Key concepts
- Commit — a snapshot of file state with a message. Immutable once created
- Branch — a parallel line of development. Cheap and fast in Git
- Merge / Rebase — integrating changes from one branch into another. Merge preserves full history; rebase creates a linear one
- Remote — a copy of the repository on a server (GitHub, GitLab, Bitbucket)
Basic commands
git init / git clone
git add . && git commit -m "message"
git push / git pull
git checkout -b feature/name
git merge / git rebase
Branching strategies
Git Flow (develop/release/hotfix), GitHub Flow (main + feature branches), Trunk-Based Development — no long-lived branches. The choice depends on team size and release frequency.