Re: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:14
Thomas Glanzmann [off-list ref] writes:
I see it. Last line. I tried to clone from a repository which itself had a detached HEAD. Could that be the problem?
Ah, our mails crossed.
There is no reason to forbid cloning of a repository whose HEAD
is detached, but detached HEAD is a relatively recent invention,
and I would not be surprised if that was indeed the breakage,
nor nobody has hit this so far.
It's sufficiently late here so I do not think I would be able to
take a look at it tonight, though. Sorry.
Just in case you need unblocking (although I think you know how
already), you should be able to continue with:
$ git rev-parse v2.6.20^0 >.git/HEAD
$ git read-tree HEAD
$ git checkout-index -f -q -u -a
That would give you a normal detached state at v2.6.20; you
should be able to come back to your branches with usual "git
checkout".