Skip to contentSkip to conversation

git-fetch fails if remote is detached HEAD

DISCUSSION Andy Parkins 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hello,

Running git-fetch from a remote repository that has a detached head fails with:

fatal: '/path/to/repository/.git': unable to chdir or not a git archive

A simple checkout at the remote end, and everything is fine again.

I can't quite see why fetch is interested in the remote HEAD at all? The only time that is ever needed is during a clone isn't it?

Andy

Signature · 2 lines
Dr Andrew Parkins, M Eng (Hons), AMIEE
[email protected]
#1 lore raw

I think it is trying to see if it is a git archive, and the version of upload-pack you are invoking is not detached-HEAD aware.