开发者

I backed up a git project, and got "fatal: Not a Git Repository"

开发者 https://www.devze.com 2022-12-11 23:31 出处:网络
I backed up a git folder from Linux onto a FAT32 external drive, and copied it back later, and it said

I backed up a git folder from Linux onto a FAT32 external drive, and copied it back later, and it said

fatal: Not开发者_StackOverflow中文版 a git repository (or any of the parent directories): .git

What may have gone wrong?


To add to your answer, there was a proposition of a patch back in 2007 allowing for name like 'head' instead of only 'HEAD'.

Needless to say, this proposition was not exactly welcomed:

Now, I realise that this might open a can of worms ... would we also want to go looking for files called "pack-ab~1.pac" ?

Hell, no.

So, to this day people still rename head in HEAD when that happens.


How to break your git repository suggests trying either

find . -type f -print0 | xargs -0 chmod a-x

or renaming head to HEAD.

The latter fixed it for me.

0

精彩评论

暂无评论...
验证码 换一张
取 消