Skip to content

Instantly share code, notes, and snippets.

@pjkelly
Created April 12, 2013 15:44
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pjkelly/5372982 to your computer and use it in GitHub Desktop.
Save pjkelly/5372982 to your computer and use it in GitHub Desktop.
GitHub Flow: Keeping Feature Branches Up-to-Date & Merging Work Back Into Master

Keeping Feature Branches Up-to-Date & Merging Work Back Into Master

The basic flow is this:

  • When you want to update a feature branch you're working on, rebase on to it.
  • When you're ready to integrate the work you've been doing into the master branch, merge it.

Detailed Step-by-Step

Given the name of your feature branch is registration-page:

  1. Commit what you've got on your feature branch.
  2. Checkout master: git checkout master
  3. Update master: git pull
  4. Switch back to your feature branch: git checkout registration-page
  5. Rebase master on top of your feature branch: git rebase master
  6. Resolve any conflicts that arise (if any).

Optional (if you're ready to merge your work into master & deploy):

  1. Checkout master: git checkout master
  2. Merge your feature branch into master: git merge registration-page
  3. Push to origin: git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment