有人将称为 Git 推力源测试的分支推向共享仓库 。 我可以看到有 git 分支 -r 的分支 。 我如何查看远程测试分支 ? 我试过 :
git 检出测试, 它不会给 git 检出源/ 测试提供任何结果 * (无分支)
有人将称为 Git 推力源测试的分支推向共享仓库 。 我可以看到有 git 分支 -r 的分支 。 我如何查看远程测试分支 ? 我试过 :
git 检出测试, 它不会给 git 检出源/ 测试提供任何结果 * (无分支)
当前回答
有许多替代办法,例如:
替代 1: git 抓取 git 检出测试, 这是最简单的方法 。 替代 2: git 抓取 git 检出测试相同, 但分为两步 。
其他回答
git 分支 -r 表示对象名称无效, 因为该分支名称不在 Git 的本地分支列表中。 从源头更新您的本地分支列表 :
git remote update
然后尝试再检查一下你的远程分支。
这是为我工作。
我相信在所有偏远的树枝里都会拉拉, 这并不是最初的海报所希望的。
您可以尝试
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 检查您的处名
似乎没有人提出最简单的方法(也许我太笨了,
git pull origin remoteBranchName
git switch remoteBranchName
同一个案例(在我最后一次拉拉请求后,在遥控器上创建了一个分支)为我工作。
您可以开始跟踪所有远程分支, 使用以下制表单脚本 :
#!/bin/bash
git fetch --all
for branch in `git branch -r --format="%(refname:short)" | sed 's/origin\///'`
do git branch -f --track "$branch" "origin/$branch"
done
这里还有一个单行版本 :
git fetch --all; for branch in `git branch -r --format="%(refname:short)" | sed 's/origin\///'`; do git branch --track "$branch" "origin/$branch" ; done ;