Git: cannot checkout branch - error: pathspec '…' did not match any file(s) known to git

后端 未结 30 3295
太阳男子
太阳男子 2020-11-27 23:54

I\'m not sure why I\'m unable to checkout a branch that I had worked on earlier. See the commands below (note: co is an alias for checkou

30条回答
  •  抹茶落季
    2020-11-28 00:52

    In my case I had renamed a file changing the case of the file, i.e. SomeFile.js -> someFile.js

    I think that was related to the problem. Doing a git fetch didn't fix the issue.

    I moved the files out of my project, did a fetch, and did a push without them. Then I did a fetch, added them back, and did a push, and it worked. I don't know if all those steps were needed, but it did ultimately work.

提交回复
热议问题