“无法更新路径并同时切换到分支” [英] "Cannot update paths and switch to branch at the same time"

查看:2593
本文介绍了“无法更新路径并同时切换到分支”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有时使用 checkout -b 选项来创建一个新分支,同时检查它并在一个命令中设置跟踪。

I sometimes use the checkout -b option to create a new branch, check it out at the same time and set up tracking in one command.

在新环境中,出现此错误:

In a new environment, I get this error:

$ git checkout -b test --track origin/master
fatal: Cannot update paths and switch to branch 'test' at the same time.
Did you intend to checkout 'origin/master' which can not be resolved as commit?

为什么Git不喜欢它?

Why does Git not like it? This used to work with the same repo.

推荐答案


' origin / master '无法解析为提交

奇怪:您需要检查您的遥控器:

Strange: you need to check your remotes:

git remote -v

确保 origin 被提取:

And make sure origin is fetched:

git fetch origin

然后:

Then:

git branch -avv

(要查看您是否已经获取了 origin / master 分支)

(to see if you do have fetched an origin/master branch)

这篇关于“无法更新路径并同时切换到分支”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆