Loading...
Loading...
Use when selecting commits, ranges, or historical refs in git — covers ^, ~, .., ..., @{N}, @{time}, --not, and pickaxe content selectors
npx skill4agent add narenaryan/agent-skills git-revisions-syntax| Syntax | Meaning |
|---|---|
| SHA prefix (≥4, unambiguous) |
| current commit |
| first parent |
| second parent (merge's other side) |
| walk N steps along first parent |
| chained: grandparent's merge sibling |
| 2 reflog entries ago |
| reflog by time |
| previously checked-out branch |
| upstream / push target |
| deref annotated tag to commit |
| newest commit whose msg matches regex |
^N~N| Syntax | Meaning |
|---|---|
| in B, not A |
| symmetric diff (either but not both) |
| same as |
| in A or B, not C |
git log origin/main..HEAD # unpushed
git log --left-right main...feature # side-marked
git log HEAD --not release/*git log -S"token" # commits where literal token count changed
git log -S"pat" --pickaxe-regex
git log -G"regex" # commits touching any matching line
git log -L :funcName:file.js # evolution of a function
git log -L 10,20:file.js # evolution of line range-S-Ggit rev-parse HEAD~3 # resolve to full SHA
git merge-base A B # nearest common ancestor
git name-rev <sha> # which branch/tag contains it@{N}@{time}HEAD^A..BB..A