I'm fairly new to git. Currently I try to follow this tutorial to overlay the icon of my app with branch name and version: http://www.merowing.info/2013/03/overlaying-application-version-on-top-of-your-icon/
I get however an error when executing
git rev-parse --abbrev-ref HEAD
warning: refname 'HEAD' is ambiguous.
error: refname 'HEAD' is ambiguous
googling brought up some results suggesting that this happens when there is a branch named 'HEAD' - but I don't think that's the case. At least in the online repository on bitbucket I don't see any branch labeled 'HEAD' and querying it through the terminal yields:
git branch -r
origin/#224-Push-notifications
origin/1.0.2
origin/HEAD -> origin/master
origin/app-forced-update
origin/master
origin/milestone6
origin/staging
git branch
* #224-Push-notifications
1.0.2
HEAD
master
milestone3
milestone4
milestone5
milestone6
not sure why on the remote HEAD there is a -> while on the local HEAD there is none. maybe that's the problem?
also, searching for HEAD in the .git folder yields
find .git -name HEAD
.git/HEAD
.git/logs/HEAD
.git/logs/refs/heads/HEAD
.git/logs/refs/remotes/origin/HEAD
.git/refs/heads/HEAD
.git/refs/remotes/origin/HEAD
anyone understands what's the issue and how I can cleanly resolve it?
You've got a local branch called HEAD, so git doesn't know whether you're referring to that or the HEAD, which is the latest commit in the current branch. It's not a good idea to name a branch HEAD, so you should delete it: git branch -D HEAD. This'll fix the rev-parse error.
origin/HEAD -> origin/master in the remote branches is a remote-specific thing that means the master branch will be checked out when you clone from the remote.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With