Git · Senior · Question 3 of 76
What is a ref in Git internally?
- 1A diff between two branches, stored on disk
- 2A full copy of a commit that is kept for safety
- ✓Correct answer: A name storing a commit hash, like
refs/heads/main
Explanation
Refs live as small files or in packed-refs. HEAD is a symbolic ref pointing to another ref. Moving a branch is just writing a new hash into its ref.