Skip to content

Instantly share code, notes, and snippets.

@zachlatta
Last active November 3, 2015 17:37
Show Gist options
  • Save zachlatta/8ce037abefcbff3d765a to your computer and use it in GitHub Desktop.
Save zachlatta/8ce037abefcbff3d765a to your computer and use it in GitHub Desktop.

Suggested format for merging pull requests from forks that require changes.

In the following commands I assume Beeblebrox is the user who submitted a pull request from their fork, hackedu is the name of the repository (and their fork), and you're starting on the master branch.

# Update the master branch on our local copy of the repository

$ git pull origin master

# Create a branch to work with their pull request in and fetch and rebase the
# changes made in their pull request on top of the branch you just created
# (which has the latest changes from the upstream repository)

$ git checkout -b Beeblebrox/branch-name master
$ git pull --rebase https://github.com/Beeblebrox/hackedu.git branch-name

# Make any other changes you'd like to make to their pull request now

# Push your branch with their modified changes in it

$ git push origin Beeblebrox/branch-name

Now go to the repository on GitHub (ex. https://github.com/hackedu/hackedu) and create a new pull request from the branch you just pushed. Make sure to mention Closes #original_pr_number in the pull request description so the original pull request is closed when this is merged. After you've created the pull request and verified that the tests pass (and you're happy with all the changes), go ahead and merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment