我有一个github
帐户,我用它从两个不同的机器。一方面,我创建了一个新分支myNewBranch
并切换到它。然后我对我的代码做了修改,我承诺将推到myNewBranch
。Git:无法切换到新的远程分支
在第二台机器上,我无法弄清楚如何推送到它。
$ git pull origin myNewBranch
From https://github.com/myUsername/myProject
* branch myNewBranch -> FETCH_HEAD
Already up-to-date.
[我已经成功地从它拉]
然后,我尝试切换到它,但我得到一个错误:
$ git checkout myNewBranch
error: pathspec 'myNewBranch' did not match any file(s) known to git.
我缺少什么?
工作,谢谢!但是我做了一个大混乱:在我的问题中描述的行动中,我从myNewBranch退到了另一个分支。现在,我实际上希望远程保持这个不同的分支,并将我所做的更改推送到myNewBranch。这可能吗? –
找到它了:http://stackoverflow.com/questions/8550586/how-to-push-from-one-branch-to-another-and-checkout –