有人推了一个分行test
与git push origin test
共享仓库的共享仓库。git branch -r
如何查看遥控器test
我试过了
git checkout test
,它没有做任何事情git checkout origin/test
给给* (no branch)
有人推了一个分行test
与git push origin test
共享仓库的共享仓库。git branch -r
如何查看遥控器test
我试过了
git checkout test
,它没有做任何事情git checkout origin/test
给给* (no branch)
当前回答
命令
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
两者将创造latest fixes_for_dev
调自development
其他回答
您可以开始跟踪所有远程分支, 使用以下 Bash 脚本 :
#!/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 ;
从远程获取并检查分支。
git fetch <remote_name> && git checkout <branch_name>
例如:
git 获取来源 git 检出功能/ XYZ-1234- Add- 警告
我被困在一个状况中看到error: pathspec 'desired-branch' did not match any file(s) known to git.
以上所有建议。我正在讨论Git 1.8.3.1版本。
所以这个为我工作:
git fetch origin desired-branch
git checkout -b desired-branch FETCH_HEAD
背后的解释是,我注意到 当我拿起遥控树枝时,时前:
git fetch origin desired-branch
From github.com:MYTEAM/my-repo
* branch desired-branch -> FETCH_HEAD
在您的情况中,您可以使用此命令 :
git checkout -b test origin/test
我总是这样:
git fetch origin && git checkout --track origin/branch_name