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

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


当前回答

您可以尝试

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 && git checkout dev

要克隆 git 仓库,请:

git clone <either ssh url /http url>

以上命令检查所有分支,但只有主分支会被初始化。如果您想要检查其它分支,请做 :

git checkout -t origin/future_branch (for example)

此命令检查远程分支, 您的本地分支名称将与远程分支相同 。

如果您想要在退出时覆盖您的本地分支名称 :

git checkout -t -b enhancement origin/future_branch

您的本地分支名称是增强, 但您的远程分支名称是未来_ branch 。

工作命令

git 获取源“ remote_ branch ” : “ 本地_ branch_ name” git开关 “ 本地_ branch_ name” git pull 源“ remote_ branch ” : “ 本地_ branch_ name ”

第一个是从远程分支获取分支和创建本地分支。

第二个是转换到当地分行。

第三是将最近的远程更改拖到本地分支。

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

$ git checkout -t remote_name/remote_branch

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

$ git remote add remote_name location_of_remote
$ git fetch remote_name

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

这些答案对我毫无用处。

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