Raising a Pull Request and Merging from Upstream

Adam Tuttle has a great posting on raising your first pull request and merging subsequent upstream changes into your locally cloned repo.

TL;DR

Raising a Pull Request

  • Fork the source repo into your online account
  • Clone the remote repo from your online account to your local machine
  • Create a local working branch from your local master branch
  • Make your changes and commit them to your local working branch
  • Push the local working branch to your remote repo
  • Raise a pull request on the source repo with the HEAD of your remote working branch as the candidate

Refreshing from the Upstream Repo

  • Add a new remote repo, named upstream, to your local clone of the repo which is linked to the source repo
  • Merge the upstream branch master, into your local master branch
  • Merge your local master branch into your working branch
  • Make your changes and commit them to your local working branch
  • Before raising your pull request, merge the upstream branch master into your local working branch to ensure you've got all the changes that might have been committed since your original pull from the source repo