Warm tip: This article is reproduced from serverfault.com, please click

git-检出PR的远程分支

(git - checkout remote branch of the pr)

发布于 2020-12-02 10:33:11

我该如何前往其他人推销的分支机构?说这个名字是功能修复,所以我所做的是

git remote add upstream <git_url>
git checkout -b upstream/feature-fix

我很致命:找不到远程参考功能修复

Questioner
Nadiely Jade
Viewed
0
LeGEC 2020-12-02 18:39:19

如果feature-fix你的遥控器中有一个命名的分支,那么大多数情况下应该可以使用的命令很简单:

git checkout feature-fix

如果你需要明确指出应定位的远程对象(例如feature-fix,两个远程对象中已有一个分支:originupstream):

# 'git checkout -b' will create the new local branch
# 'git branch -u' will make that local branch track 'upstream/feature-fix'
git checkout -b feature-fix upstream/feature-fix
git branch -u upstream/feature-fix