git pointer

Creator
Creator
Seonglae Cho
Created
Created
2021 Apr 23 10:0
Editor
Edited
Edited
2025 Jun 7 16:27
Refs
Refs
While Git does not have a "pointer object" type, tag objects and refs serve as pointers that reference existing objects. In other words, they are simply names that point to a commit object's SHA-1 hash.
  • HEAD: Points to currently checked out commit (usually points to branch)
  • Branch names (e.g. main, dev): Mutable refs pointing to specific commits
  • tag: Immutable ref pointing to specific commit
  • ORIG_HEAD: Points to HEAD position before rebase, merge, reset
  • FETCH_HEAD: Points to latest commit from fetch
  • MERGE_HEAD: Points to merge target commit during merge conflicts
  • CHERRY_PICK_HEAD: Points to cherry-pick commit during conflicts
  • REBASE_HEAD: Points to state during rebase conflicts
git show HEAD git show main
ls .git/refs/heads ls .git/refs/tags
git pointers
 
 
 
 
 
 
 

Recommendations