All of a sudden i am getting this git error: ""git status --porcelain failed"" when i do a git status.... whats up with that?
Porcelain Format Version 1 Version 1 porcelain format is similar to the short format, but is guaranteed not to change in a backwards-incompatible way between Git versions or based on user configuration. This makes it ideal for parsing by scripts.
In order to add a Git submodule, use the “git submodule add” command and specify the URL of the Git remote repository to be included as a submodule. When adding a Git submodule, your submodule will be staged. As a consequence, you will need to commit your submodule by using the “git commit” command.
In my case, I have moved a submodule to another directory and I got that error message.
.gitsubmodule
to match current path of submodule.<currentPathOfSubmodule>/.git
, the gitdir
must match .git/modules/<pathOfSubmodule>
. It has a lot of ../../
, you can use ls
to check.Got that error :-)
fatal: Could not chdir to ../<someWhere>
: No such file or directory
fatal: git status --porcelain
failed in submodule
Edit .git/modules/<pathOfSubmodule>/config
, the worktree
must match current path of submodule.
Done.
This error message is found in some similar StackOverflow questions: here, here. Googling brings up a mailing list message with this error. Nobody has given an explanation why it occurs, so I thought I'd add what I've found.
Some overview of terminology, from the man git
page:
GIT COMMANDS
We divide git into high level ("porcelain") commands and low level ("plumbing") commands.
From the above posts, it would appear that, when git status
is run, it calls git status --porcelain
. man git-status
helpfully informs us what the --porcelain
flag is for:
--porcelain
Give the output in an easy-to-parse format for scripts. This is similar to the short output, but will remain stable across git versions and regardless of user configuration. See below for details.
So the issue you have is related to the git status
call, which is by default trying to format its output into something easy to parse.
From the above posts, noticably the answers here and the mailing list contentets, I would suggest that, for whatever reason, your git repository has become corrupted. If you're using submodules, it's possible one of those has become corrupted - this is relevant because
status run "git status --porcelain" inside each populated submodule to see if it contains changes (link)
unless explicitly told not to do so.
As to why you seem to have a corrupted git repository? I don't know. Several other people on StackOverflow have mentioned overwriting, moving, replacing, or generally fiddling with .git
directories in their repositories. Luckily, you have a backup, though, right? ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With