GitHub clone from pull request?

I would like to clone a repository from GitHub. The problem is I don't want the main branch; I want the version in this unapproved pull request.

Is it possible for me to clone the pull request version instead of the main repository?


You can clone the branch you want by using the -b option in the git clone command.

In your case, the branch you want to clone is the source branch of the pull request (feature/mongoose-support):

git clone https://github.com/berstend/frappe.git -b feature/mongoose-support /my_clone

The easiest way to do that is like this:

git fetch origin pull/2/head
git checkout -b pullrequest FETCH_HEAD

You will now be on a new branch that is on the state of the pull request.


git fetch origin refs/pull/PR_NUMBER/head:NEW_LOCAL_BRANCH

eg:

$ git fetch origin pull/611/head:pull_611
$ git checkout pull_611

Make changes, commit them, PUSH and open new PR from your fork on GitHub

链接地址: http://www.djcxy.com/p/22458.html

上一篇: 你如何将一个新的pull请求附加到github上的现有问题上?

下一篇: GitHub克隆从拉请求?