有人推了一个分行test
与git push origin test
共享仓库的共享仓库。git branch -r
如何查看遥控器test
我试过了
git checkout test
,它没有做任何事情git checkout origin/test
给给* (no branch)
有人推了一个分行test
与git push origin test
共享仓库的共享仓库。git branch -r
如何查看遥控器test
我试过了
git checkout test
,它没有做任何事情git checkout origin/test
给给* (no branch)
当前回答
我被困在一个状况中看到error: pathspec 'desired-branch' did not match any file(s) known to git.
以上所有建议。我正在讨论Git 1.8.3.1版本。
所以这个为我工作:
git fetch origin desired-branch
git checkout -b desired-branch FETCH_HEAD
背后的解释是,我注意到 当我拿起遥控树枝时,时前:
git fetch origin desired-branch
From github.com:MYTEAM/my-repo
* branch desired-branch -> FETCH_HEAD
其他回答
你基本上看到了树枝,但你还没有本地的拷贝!
你需要,你需要fetch
分支...
您可以简单地获取并退出分支, 使用下面的一条线命令来做到这一点 :
git fetch && git checkout test
我还创建了下面的图像 让你分享差异,看看如何fetch
以及它是如何与pull
:
如果该分支所在的事物上不是其他的,origin
我喜欢做以下工作:
$ git fetch
$ git checkout -b second/next upstream/next
这将检出next
分支上upstream
远程连接到一个本地分支,该分支被调用second/next
。这意味着,如果您已经拥有下一个命名为本地分支的分支,则不会发生冲突。
$ git branch -a
* second/next
remotes/origin/next
remotes/upstream/next
运行这两个命令,你应该可以去。
git checkout <branch-name>
git pull <remote> <branch-name>
你可以试试
git fetch remote
git checkout --track -b local_branch_name origin/branch_name
或
git fetch
git checkout -b local_branch_name origin/branch_name
这将DWIM DEWIM DEWIM DEWIM DEWIM DEWIM DEWIM DEWIM DEWIM DEWIM DIWIM DEWIM DIWIM DIWWM DI DIWIM DI DIWIM DI DIWIM DI DIWM DIWIM DI DIWM DI DI DIWIM DI DI DIWM远程未命名来源( 用于远程未命名来源) 。文档文件文件):
$ git checkout -t remote_name/remote_branch
要添加一个新的远程, 您需要首先做以下操作 :
$ git remote add remote_name location_of_remote
$ git fetch remote_name
第一个告诉Git 遥控器存在, 第二个得到承诺。