...
First, you need to have remotes set up in your working copy for both the ASF maintained repo and the GitHub mirror. You can view your remotes with
Code Block | ||
---|---|---|
| ||
git remote -v |
If you don't already have both remotes set up, you can add them with
...
If you already have remotes setup, but have different names, you'll need to change the names used in the commands on this page accordingly. If you would like to rename any existing remotes, use the following command:
Code Block | ||
---|---|---|
| ||
git remote rename <current name> <new name> |
Next, set your working copy to be on the desired branch and ensure it is up to date.
...
The following command will grab the pull request into a new branch in your working copy. NUMBER represents the number of the pull request.
Code Block | language | bash
---|
git fetch vcl-github pull/NUMBER/head:pr/NUMBER |
If you will be working with a number of pull requests, you may want to issue the following configuration change to simplify things.
Code Block | ||
---|---|---|
| ||
git config --add remote.vcl-github.fetch '+refs/pull/*/head:refs/remotes/vcl-github/pr/*'
|
After that, you can run the following two commands, which are a little easier to remember.
Code Block | ||
---|---|---|
| ||
git fetch vcl-github git checkout pr/NUMBER |
...
To view a diff of the changes between the branch you currently have checked out and the new one created from the pull request, use git diff:
Code Block | language | bash
---|
git diff pr/NUMBER |
Use the following command to merge the pull request. NOTE: The "--no-ff" argument and the comments are important. The phrase "This closes #NUMBER" must be included in the comment to cause the pull request to be closed on GitHub. Also, if a JIRA issue is associated with the work, the issue number (VCL-###) needs to be included in the comment.
Code Block | ||
---|---|---|
| ||
git merge --no-ff -m "VCL-## - This closes #NUMBER" pr/NUMBER |
For example, to handle PR#2 that addresses VCL-1101, the following would be used:
Code Block | ||
---|---|---|
| ||
git merge --no-ff -m "VCL-1101 - This closes #2" pr/2 |
...
Optionally, diff the changes against the ASF repo to double check before pushing to it. <branch> should be the same branch that was checked out in the Working Copy section above.
Code Block | language | bash
---|
git diff vcl-asf/<branch> |
...