有人将称为 Git 推力源测试的分支推向共享仓库 。 我可以看到有 git 分支 -r 的分支 。 我如何查看远程测试分支 ? 我试过 :

git 检出测试, 它不会给 git 检出源/ 测试提供任何结果 * (无分支)


当前回答

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

git 检出 -b 测试来源/测试

其他回答

i 使用了这一个:

git clean -fxd                         # removes untracked (new added plus ignored files)

git fetch
git checkout {branchname}

git reset --hard origin/{branchname}   # removes staged and working directory changes

这将为未命名的远程来源( 文档) 提供宽度 :

$ git checkout -t remote_name/remote_branch

添加新的远程,您需要首先做以下操作:

$ git remote add remote_name location_of_remote
$ git fetch remote_name

第一次告诉遥控器的存在, 第二次得到承诺。

我不确定 我日复一日地干这个 下个命令就像宝石一样

成为你要退房的分行

git fetch && git checkout dev

我尝试了上述解决方案,但行不通。试试这个,它奏效了:

git fetch origin 'remote_branch':'local_branch_name'

这将获取远程分支, 并创建一个新的本地分支( 如果尚未存在的话) , 名称为本地_ branch_ name , 并跟踪其中的远程分支 。

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

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