Creating new Refs
suggest changeRunning git checkout -b <refname> will create a new ref that points to the current commit.
$ cat .git/HEAD
ref: refs/heads/main
$ git checkout -b TestBranch
$ cat .git/HEAD
ref: refs/heads/TestBranch
$ cat .git/refs/heads/TestBranch
1f324a
.git/HEAD names the current branch. The commit hash is stored in the branch ref. If that ref is packed, it may live in .git/packed-refs instead of .git/refs/heads/TestBranch.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents