简体   繁体   English

有没有一种方法可以在不设置遥控器的情况下签出Github存储库和分支?

[英]Is there a way to checkout a Github repo and branch without setting up a remote?

To evaluate a pull request to our project repo seems to require doing this: 要评估对我们项目回购的拉取请求,似乎需要执行以下操作:

git remote add newcontributor https://github.com/newcontributor/ourproject
git fetch newcontributor
git checkout newcontributor/pr-branch
...
git remote rm newcontributor

Is there a simpler way? 有没有更简单的方法?

Ah, Github makes this easy. 啊,Github让这变得容易。 At the bottom of the Pull Request page, there's a link: 在“拉取请求”页面的底部,有一个链接:

在此处输入图片说明

This gives the commands, using git pull to merge from a URL: 这给出了使用git pull从URL合并的命令:

git checkout -b newcontributor-prbranch master
git pull https://github.com/newcontributor/ourproject.git pr-branch

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM