Why do I get “fatal: git status --porcelain failed”?

前端 未结 13 1876
星月不相逢
星月不相逢 2020-12-09 07:39

This is a huge pain in the bum. I\'ve got this a few times before and I don\'t understand why. 5 mins ago the repo was fine and working, I move some files around (which is a

相关标签:
13条回答
  • 2020-12-09 08:03

    Oh dear I'm such a fail. It looks like the problem stems from Flash Builder copying over other .git repos into sub folders. The answer is to remove all .git folders that aren't the repo's one.

    0 讨论(0)
  • 2020-12-09 08:03

    Usually, git creates a hidden directory in project's root directory (.git/)

    When you're working on a CMS, its possible you install modules/plugins carrying .git/ directory with git's metadata for the specific module/plugin

    If you do not want to use git's submodules feature, quickest solution delete all .git directories except root git metadata directory. If you do so, git will not consider those modules as project submodules.

    cd /path/to/your/project/code
    find ./ | grep ".git/index"
    

    Once located delete ".git" all directories except the root one, but if you deleted it initialize your repo again

    0 讨论(0)
  • 2020-12-09 08:07

    I ran into this error because of a corrupted/not properly initialized submodule (with its own .git subfolder). I temporarily deleted the submodules folder and used git init in the main project's root. Fixed the problem for me.

    0 讨论(0)
  • 2020-12-09 08:13

    I don't have any .git folders in my repo, but anytime I copy my new files into my folder to update my app, I am still getting index corrupt porcelain failed errors. I don't understand how updating files would corrupt this or how to fix it. Anyone have further insight on this?

    0 讨论(0)
  • 2020-12-09 08:16
    git remote -v
    #now run the same commands 
    git remote add origin remote-repository-url.git
    git push origin master
    

    // It's work very well

    0 讨论(0)
  • 2020-12-09 08:20

    .git is a file in submodules and points to a directory located in your root .git directory.

    In my case, I was mounting a git directory in docker and checking status there. The .git file of this submodule contained an absolute path which was invalid in docker. I edited this .git file to change the gitdir path to a relative path.

    Git version: 2.7.4

    0 讨论(0)
提交回复
热议问题