开发者

git add causes corrupt index error

开发者 https://www.devze.com 2023-04-12 15:45 出处:网络
I am having a bit of a problem here with git. I have a drupal set up. I have the proper .gitignore set up.

I am having a bit of a problem here with git. I have a drupal set up. I have the proper .gitignore set up.

everytime i do git add . and git status. i get index file corrupt error.

I followed this Ho开发者_运维问答w to resolve "Error: bad index – Fatal: index file corrupt" when using Git to fix it, but it keeps coming back. I tried removing entire .git folder. but it didnt work.

Does anyone know how to fix this?


I was having this exact problem.

I figured out my problem was that there were two other .git folders in subdirectories. I had cloned two repos into these sub folders. I removed these two .git folders and I was able to use git again.

To find these other .git folders I ran this command:

find . -name ".git" -type d
0

精彩评论

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

关注公众号