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

前端 未结 13 1914
星月不相逢
星月不相逢 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:21

    I had the same issue. Running git status in my root project's directory produced the following error:

    fatal: This operation must be run in a work tree
    fatal: 'git status --porcelain' failed in submodule js/object-subscribe
    

    Running git status in the affected submodule (js/object-subscribe) would produce this error:

    fatal: This operation must be run in a work tree
    

    Running git init in that submodule's folder did it for me.

提交回复
热议问题