您的位置:首页 > 其它

fatal: Cannot update paths and switch to branch 'gitlab' at the same time.

2015-10-22 18:42 597 查看
I believe this occurs when you are trying to checkout a remote branch that your local git repo is not aware of yet. Try:

git remote show origin


If the remote branch you want to checkout is under “New remote branches” and not “Tracked remote branches” then you need to fetch them first:

git remote update


git fetch


Now it should work:

git checkout -b local-name origin/remote-name


还有一种方法:

直接执行如下命令:

git fetch --all && git fetch -t
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: