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

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.


In case it helps anyone else, I just encountered the same issue and found that running git init in the project root fixed it.


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.


I know this is an old thread, but I just had the same problem and ended up solving in a different way. The git init didin't work for me. Posting here, in case it's useful to anyone else.

My repository has two submodules. After rebasing I started getting the error fatal: git status --porcelain failed.

The solution was to verify the property worktree in every submodule config file - e.g. <repository-checkout>/.git/modules/<submodule-name>/config.

I had one invalid path for the worktree property. It was linking to an unexisting folder that was changed and merged to master - probably due an error resolving conflicts.

Tags:

Versioning

Git