Lets say I'm in a detached HEAD state and I run the following command:
git push origin HEAD:foo
git will output the following error:
error: The destination you provided is not a full refname (i.e.,
starting with "refs/"). We tried to guess what you meant by:
- Looking for a ref that matches 'foo' on the remote side.
- Checking if the <src> being pushed ('HEAD')
is a ref in "refs/{heads,tags}/". If so we add a corresponding
refs/{heads,tags}/ prefix on the remote side.
Neither worked, so we gave up. You must fully qualify the ref.
hint: The <src> part of the refspec is a commit object.
hint: Did you mean to create a new branch by pushing to
hint: 'HEAD:refs/heads/foo'?
error: failed to push some refs to 'https://server/DefaultCollection/Project/_git/Repo'
So my question is: What is the correct keyword to use here instead of "HEAD" to reference the current commit I'm on? I can copy paste the commit id, but that's obviously silly. I'm asking for a constant name I can type, like head, to represent the current commit I'm on.
xterm
will do an html or svg screen dump that preserves colors and such in case that matters, surely every can do as well.HEAD
in all uppercase. Lowercase will sometimes work, and sometimes not. To see why, read my answer to HEAD vs head vs detached HEAD. (This isn't the issue here, it's just a general rule. The actual issue is the one in jthill's answer.) Note: if you don't like holding down the shift key that long, consider using@
instead ofHEAD
: it works the same and avoids typing three of the four characters.