有人推了一个分行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)
当前回答
工作命令
git fetch origin 'remote_branch':'local_branch_name'
git switch 'local_branch_name'
git pull origin 'remote_branch':'local_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
如果该分支所在的事物上不是其他的,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
对我们来说,似乎remote.origin.fetch
配置存在一个问题。 因此, 我们无法看到比master
, 如此git fetch [--all]
没有帮助,也没有帮助。git checkout mybranch
英git checkout -b mybranch --track origin/mybranch
确实工作过,虽然肯定在遥远的地方。
仅允许上一个配置master
要获取的 :
$ git config --list | grep fetch
remote.origin.fetch=+refs/heads/master:refs/remotes/origin/master
通过使用来修补它*
从源头获取新信息 :
$ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
$ git fetch
...
* [new branch] ...
...
现在我们可以git checkout
本地边远分支。
我不知道这个配置怎么会 出现在我们本地的仓库里
这将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 遥控器存在, 第二个得到承诺。
首先,你需要做的是:
git fetch
如果你不知道 分支名称
git fetch origin branch_name
第二,您可通过下列方式检查远程分支进入本地 :
git checkout -b branch_name origin/branch_name
-b
将从您选中的远程分支中以指定的名称创建新分支 。