error: pathspec 'test-branch' did not match any file(s) known to git

后端 未结 11 1810
刺人心
刺人心 2020-12-13 17:31

I am a new user of Git. I have forked a repository called Spoon-Knife (available for practicing forking with Git). Then, I cloned it locally by running

git c         


        
11条回答
  •  南笙
    南笙 (楼主)
    2020-12-13 18:06

    You can also get this error with any version of git if the remote branch was created after your last clone/fetch and your local repo doesn't know about it yet. I solved it by doing a git fetch first which "tells" your local repo about all the remote branches.

    git fetch
    git checkout test-branch
    

提交回复
热议问题