Milestones & Parent Tracking
Git Tags (Permanent Anchors)
While branches move forward automatically as you write new code, a tag stays glued to one specific save forever. Think of it like a milestone marker (e.g., v1.0-Launch). You cannot work directly on a tag; it's just a permanent signpost.
# Mark save point 'c1' as Version 1
git tag v1 c1
# Tag your current exact location
git tag v1
# Go back and look at that milestone
git checkout v1
Git Describe (Where am I?)
Because tags are permanent signposts, you can ask Git to tell you exactly where you are standing relative to the nearest milestone.
git describe main
How to Read the Output
The answer will look something like this:
Example: v1-2-gC2 means: "You are 2 saves ahead of the 'v1' tag, and your current save ID starts with C2."
Tricky Paths: Merge Parents
When you merge two timelines together, that new merge point has two parents (the two lines that joined). If you want to jump backward in time, Git won't know which path to walk down.
By default, Git walks down the first path. You can tell it to walk down the second path by adding a number after the ^ symbol.
# Move backward along the second parent path
git checkout main^2
# Chain things together to navigate complex paths
git checkout HEAD~^2~2