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

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

    I copied remote origin url from another .git/config file, doing so my new .git/config file was missing following line in [remote "origin"] section

    fetch = +refs/heads/*:refs/remotes/origin/*
    

    Adding above line fixed error: pathspec 'master' did not match any file(s) known to git.

提交回复
热议问题