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

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

当前回答

你可以试试

git fetch remote
git checkout --track -b local_branch_name origin/branch_name

git fetch
git checkout -b local_branch_name origin/branch_name

其他回答

从远程获取并检查分支。

git fetch <remote_name> && git checkout <branch_name> 

例如:

git 获取来源 git 检出功能/ XYZ-1234- Add- 警告

你基本上看到了树枝,但你还没有本地的拷贝!

你需要,你需要fetch分支...

您可以简单地获取并退出分支, 使用下面的一条线命令来做到这一点 :

git fetch && git checkout test

我还创建了下面的图像 让你分享差异,看看如何fetch以及它是如何与pull:

git fetch

在您的情况中,您可以使用此命令 :

git checkout -b test origin/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本地边远分支。

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

这将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 遥控器存在, 第二个得到承诺。