Git Branching Quick Reference

Common branching commands (create, switch, merge, rebase).

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all

Create & switch

Create & switch (modern)

bashANYgitbranchswitch
bash
git switch -c feature/my-work

Create & switch (legacy)

Older equivalent

bashANYgitbranchcheckout
bash
git checkout -b feature/my-work  # older
Notes

Prefer `git switch` for newer Git versions, but `checkout` still exists in many guides.

Sync with dev

Sync feature with dev (merge)

bashANYgitbranchmerge
bash
git fetch origin
git switch feature/my-work
git merge origin/dev
Notes

Prefer merge for a quick sync; use rebase if your team prefers a linear history.