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

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

当前回答

运行这两个命令,你应该可以去。

git checkout <branch-name>
git pull <remote> <branch-name>

其他回答

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

git checkout -b test origin/test

主题说明:与现代基特()1.6.6),您可以使用

git checkout test

(请注意“测试”不是“原产/测试”)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-为您创建本地的“测试”分支, 上游是远程跟踪分支“ 源/ 测试 ” 。


缩略* (no branch)git branch输出是指您在未命名的分支上, 即所谓的“ 列列 HEAD ” 状态( HEAD 指点直接承诺, 而不是某些本地分支的象征性引用) 。 如果您在这个未命名的分支上做了一些承诺, 您总是可以在当前承诺中创建本地分支 :

git checkout -b test HEAD

评论意见中建议的一种更现代的方法:

@Dennis:git checkout <non-branch>,例如,git checkout origin/test产生独立的总部领导/未命名分支,而git checkout testgit checkout -b test origin/test地方分支的成果test(与远程跟踪处一起)origin/test计为上游上游- 贾库布·纳拉斯基14日8: 17

重点强调git checkout origin/test

命令

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 fetch --all

将所有远程分支都带回您的本地

git checkout test

将您切换到测试分支

缩略git remote show <origin name>命令将列出所有分支(包括未跟踪的分支)。然后您可以找到要获取的远程分支名称。

示例:

git remote show origin

使用这些步骤获取远程分支 :

git fetch <origin name> <remote branch name>:<local branch name>
git checkout <local branch name > (local branch name should the name that you given fetching)

示例:

git fetch origin test:test
git checkout test