Why does git uses 2 different commands to show HEAD?

Viewed 1377

I noticed there are 2 HEADs:

  • .git\HEAD
  • .git\refs\remotes\origin\HEAD

When I use git show-ref HEAD, it only gives me this:

ce0762c073b407d794f54f0b5d2a50375fdcb609 refs/remotes/origin/HEAD

Whle when I use git rev-parse HEAD, it gives me the value of .git\HEAD:

a758e523fe40e799194878bac567b7f4b8eec2b9

Why Git use 2 different commands to show HEAD? Any strong reason?

2 Answers
Related