What does .git/HEAD contain now?
$ git checkout 3f9c2a1 You are in 'detached HEAD' state. $ cat .git/HEAD
ref: refs/heads/main- A raw 40-character commit hash
- An empty file until you commit
ref: refs/heads/3f9c2a1
Normally HEAD is a symbolic ref like
Play Git ▸
ref: refs/heads/main. When detached it holds the commit ID directly.