Skip to content

Instantly share code, notes, and snippets.

@harlow
Created October 26, 2012 19:10
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save harlow/3960799 to your computer and use it in GitHub Desktop.
Save harlow/3960799 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 = git@github.com: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
@croaky
Copy link

croaky commented Mar 20, 2013

@harlow Maybe simplify some of these to use the hub gem?

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