Skip to content

Refs

← All terms · Git fundamentals

Also called References

Internal pointers that map human-readable names, like branch names or tags, to the underlying complex, cryptographic commit hashes.

What it is

Refs are simple text files stored inside the .git directory containing the hash of a commit. Instead of memorizing a string like 8a5f3c, developers use refs like main or v1.0. Branches, remote tracking branches, and tags are all just different types of refs pointing to specific snapshots in history.

When you would use it

You mostly interact with refs abstractly when using branch names; you rarely manipulate ref files directly unless performing advanced repository recovery.

Common operations

  • Managing branch pointers under the hood.
  • Recovering lost commits using the reflog.

Related terms

Where this is taught

No learning path uses this term yet. Browse the Learning Atlas for guided sequences through related ideas.