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

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

    I got this error for a branch that was remote and had no local tracking branch. Even though I'm certain I've checked out remote branches via a simple

    git checkout feature/foo
    

    in the past, to get around this error I had to

    git checkout -t -b feature/foo origin/feature/foo
    

    I have no idea what I did to get myself into that situation either.

提交回复
热议问题