What is the difference between HEAD
and HEAD:HEAD
notation in git commands e.g.:
git fetch origin HEAD:HEAD
I can even understand what git fetch origin HEAD
does, however, not using the other notation.
I would be grateful for any kind of help or advice.
The notation "HEAD:HEAD" in Git commands like "git fetch origin HEAD:HEAD" may look a bit confusing, but it is essentially a shorthand for a common operation. Let me break it down for you:
HEAD (without the colon):
HEAD:HEAD (with the colon):
When you use "git fetch origin HEAD:HEAD," it is effectively saying: "Fetch the commit that 'HEAD' in the 'origin' remote repository is pointing to and update the local 'HEAD' to that same commit."