Git Internals
Remote-Tracking References
Understand the difference between `main` and `origin/main` so fetch, pull, push, and branch sync become easier to reason about.
Many sync mistakes come from not separating these two names:
main: your local branchorigin/main: your local record of the remote state
Why fetch matters
git fetch updates the remote-tracking ref, not your working branch. That separation is what lets Git say:
- learn what changed upstream
- decide how to integrate it locally
Why this helps with pull
git pull is fetch plus integration. The better you understand remote-tracking refs, the easier it becomes to reason about why pull merges, rebases, fast-forwards, or stops.
PreviousGit References and HEAD
Put branches, tags, remote-tracking refs, and HEAD into one model so Git's pointer behavior becomes easier to reason about.
NextGit Commit Graph and History ShapeUnderstand why Git history is fundamentally a graph rather than a simple timeline, and how merge and rebase reshape that graph.