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

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

当前回答

我使用以下命令:

git checkout --track origin/other_remote_branch

其他回答

git branch -r表示对象名称无效, 因为该分支名称不在 Git 的本地分支列表中。 更新您的本地分支列表来源 :

git remote update

然后再试着检查一下你的远程分支

这对我管用

我相信git fetch拉拉进全部( 全部)远端树枝,这不是最初的海报所要的。

git fetch && git checkout your-branch-name

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

git checkout -b test origin/test

要获得所有边远的分支, 请使用这个 :

git fetch --all

然后检查到分支:

git checkout test

从远程获取并检查分支。

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

例如:

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