Git could not find remote ref for tag or commit hash
I am trying to pull (I also get the same problem with fetch) to a specific tag on a remote branch. I am trying to run:
git pull origin v0.0.2.1
Where v0.0.2.1 is the name of my tag. I am getting this error message:
fatal: Couldn't find remote ref v0.0.2.1
fatal: The remote end hung up unexpectedly
I get the same error message if I replace "v0.0.2.1" with the hash for that tag, or the commit hash that the tag belongs to.
I have verified that in fact the remote has this tag and this commit (in fact, I can successfully execute the above commands on another machine that has this repository). I have verified that the .git / config files are the same on both of these machines.
Still works:
git pull origin HEAD
Also, I used
git ls-remote origin
And I get the following (among other things):
016d51475640e738b24cce2fb4019649ed81fa6b refs/tags/v0.0.2.1
Does anyone know what's going on?
I found a workaround: The following works:
git pull origin refs/tags/v0.0.2.1
This works for my task, but I really would like to know more about why this works and the other does not. If anyone can provide an explanation that would be awesome.
While reading the changes in version git
1.7.0 to 1.7.9, we can find several entries that might lead to an explanation. The ref-lookups method performed on the remote side has changed (to speed things up).
This might explain why 1.7.0 is required refs/tags/<tagname>
for sampling and 1.7.10 is not.