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

后端 未结 30 3449
太阳男子
太阳男子 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:43

    If it happens on Windows, it is probably the filename case issue.

    I had this error today - I've created new file, added to GIT, then I changed one letter in filename from lower to upper and then I couldn't to anything - commit, revert, delete file from repo.

    The only solution I found was changing the filename again back to exact same case when I added this file to GIT, then doing GIT revert to remove this file from GIT, then changing filename again as I want. After those changes I could commit to repo and then push without any problem.

提交回复
热议问题