On a case-insensitive file system, I can reference head in git commands and it works like HEAD.
git rebase -i head~4 On a case-sensitive system, I have to reference HEAD exactly.
git rebase -i HEAD~4 I miss the ease with which my fingers can spit out head without reaching for Shift, and I reference HEAD frequently enough that I'd like to alias head to it.
I found a way to do this, but it has a couple drawbacks.
git symbolic-ref head HEAD I'd have to manually set this up in each repo (though maybe there's a way I can use templates to do it automatically upon git init).
I also don't understand some of the git symbolic-ref behavior. For example, I can create an arbitrary alias to a ref,
$ git log -1 my-feature 5bb7f1e add new feature $ git symbolic-ref foo my-feature $ git log -1 foo 5bb7f1e add new feature And according to the git-symbolic-ref man page, I can also delete the symbolic-ref, but I can't get that to work:
$ git symbolic-ref --delete foo error: refusing to update ref with bad name 'foo' What am I misunderstanding about symbolic-refs? Is this a bad way to use them?
Update
If I create the head ref as:
git symbolic-ref --delete "refs/heads/head" then it lives in .git/refs/heads/head (rather than .git/head as it did in my original attempt). I can still reference it as head,
git log -1 head and symbolic-ref updates/deletes work as expected
git symbolic-ref --delete refs/heads/head
HEADwas originally actually a symlink!). To delete one that's not underrefs/, through Git commands, you can usegit update-ref -d.