Git - Refs


A ref is a human-readable name given to a commit.

refs are:

There is also symbolic refs (alias ref) point to a ref instead of directly pointing to a commit, the most common being HEAD

Ref to a SHA commit

All SHA commit are in file located under the directory git dir/refs

Example for a head

cat .git/refs/heads/main

Remote Heads Refs

remote head refs

git ls-remote --heads remote

# default
git ls-remote --heads origin
dd39a644a4a7ec3e65135baaf48acd5f7f628510        refs/heads/master
6ead0945771dfd789aa97442ff10872f9665598d        refs/heads/stable
e245797039fa7b86c3a3fb32b45cfb998d8c76cd        refs/heads/v1.13

Powered by ComboStrap