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

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


当前回答

命令命令

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

两者将创建开发中的最新修正_for_ dev

其他回答

在此情况下, 您可能想要创建一个本地测试分支, 跟踪远程测试分支 :

$ git branch test origin/test

在早期版本的 git 中, 您需要一个明确的 -- track 选项, 但是当您正在将远程分支分割出来时, 这是默认的 。

创建本地分支并切换到它,使用:

$ git checkout -b test origin/test

您可以尝试

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 仓库,请:

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 远程显示 & lt; 原始名称 & gt; 命令将列出所有分支( 包括未跟踪的分支) 。 然后您可以找到要获取的远程分支名称 。

例如:

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

git 检出 -b “branch_name” [b 意指创建本地分支]

git 分支-all

git 检出 - b “ 您的分支名称 ”

git 分支分支

git 拖拉源 "你的分支名称"

从母版分支向 dev 分支成功退出