有人推了一个分行testgit push origin test共享仓库的共享仓库。git branch -r如何查看遥控器test我试过了

  • git checkout test,它没有做任何事情
  • git checkout origin/test给给* (no branch)

当前回答

这将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 --all

然后检查到分支:

git checkout test

您可以添加一个新的分支test在本地和随后使用上:

git branch --set-upstream-to=origin/test test

对我们来说,似乎remote.origin.fetch配置存在一个问题。 因此, 我们无法看到比master, 如此git fetch [--all]没有帮助,也没有帮助。git checkout mybranchgit 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本地边远分支。

我不知道这个配置怎么会 出现在我们本地的仓库里

命令

git fetch --all
git checkout -b <ur_new_local_branch_name> origin/<Remote_Branch_Name>

等于

 git fetch --all

时和时

 git checkout -b fixes_for_dev origin/development

两者将创造latest fixes_for_dev调自development

这些答案对我毫无用处。

git checkout -b feature/branch remotes/origin/feature/branch