thesecretdogproject

next || prev

Git traps for the unwary

Mon May 25 21:48:13 BST 2009

On Friday I knew that I'd need to do a bit of work over the Bank Holiday weekend to be in good shape for taking two weeks off to get married. So I cloned my git tree to a USB flash drive at the end of the day before hurrying home for a weekend of manic house cleaning.

To my dismay, however, all was not well with my tree when I tried to use it. Git complained : "fatal: Not a git repository" as a response to any git command... and yet .git was present.

A bit of googling found the answer: since the USB flash drive was using a vfat filesystem, .git/HEAD had been helpfully renamed to .git/head, which made git angry.

The cunning fix in this case was to move the whole git repository onto a filesystem which distinguishes between upper and lower case characters, and rename .git/head to .git/HEAD.