有人将称为 Git 推力源测试的分支推向共享仓库 。 我可以看到有 git 分支 -r 的分支 。 我如何查看远程测试分支 ? 我试过 :
git 检出测试, 它不会给 git 检出源/ 测试提供任何结果 * (无分支)
有人将称为 Git 推力源测试的分支推向共享仓库 。 我可以看到有 git 分支 -r 的分支 。 我如何查看远程测试分支 ? 我试过 :
git 检出测试, 它不会给 git 检出源/ 测试提供任何结果 * (无分支)
当前回答
i 使用以下命令:
git checkout --track origin/other_remote_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
i 被困在一个看到错误的情况中: 路径谱“ 想要的分支” 与上述所有建议已知的 Git 匹配的文件不匹配 。 i' 正在 Git 1. 8. 3. 3.1 版本上 。
因此,这对我有效:
git fetch origin desired-branch
git checkout -b desired-branch FETCH_HEAD
背后的解释是,我已经注意到, 当拿起远程分支时, 它被拿到fick_head:
git fetch origin desired-branch
From github.com:MYTEAM/my-repo
* branch desired-branch -> FETCH_HEAD
您可以在本地端添加新的分支测试,然后使用:
git branch --set-upstream-to=origin/test test
似乎没有人提出最简单的方法(也许我太笨了,
git pull origin remoteBranchName
git switch remoteBranchName
同一个案例(在我最后一次拉拉请求后,在遥控器上创建了一个分支)为我工作。
使用抓取来拉动全部远程
git fetch --all
列表远程分支 :
git branch -r
列表所有您的分支
git branch -l
>>outpots like-
* develop
test
master
要取出/更改分支
git checkout master