Skip to content

Instantly share code, notes, and snippets.

@gabebw
Forked from harlow/merge_pull_requests.md
Created November 5, 2012 16:36
Show Gist options
  • Save gabebw/4018159 to your computer and use it in GitHub Desktop.
Save gabebw/4018159 to your computer and use it in GitHub Desktop.
Steps to accepting pull requests from open source contributors

Add contributors pull requests to your origin remote

# .git/config
[remote "origin"]
  fetch = +refs/heads/*:refs/remotes/origin/*
  fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
  url = [email protected]:thoughtbot/[repo].git

Fetch and checkout the remote branch. Run bundle to make sure any new dependencies are installed.

git fetch
git checkout -t origin/pr/[pull number]
bundle

Look at changes in branch

git fetch origin; git diff origin/master

Validate tests are passing

rake

Rebase interactively and squash if there are multiple commits

git rebase -i master

Merge code into master

git checkout master

git merge branch-name

Validate tests are still passing

rake

Push code to origin master

git push origin master

Clean up branch and remote

git branch -D branch-name

git remote rm user-name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment