Skip to content

Instantly share code, notes, and snippets.

@marcuswestin
Last active January 2, 2016 22:09
Show Gist options
  • Save marcuswestin/8368115 to your computer and use it in GitHub Desktop.
Save marcuswestin/8368115 to your computer and use it in GitHub Desktop.
git rebase workflow

(use git rebase -i)

  1. Pull master

git checkout master
git fetch origin && git merge master # or, `git pull origin master`
  1. Create feature branch

git checkout -b awesome-feature
  1. Push remote branch

git push -u origin awesome-feature 
  1. Keep feature branch up to date

With master:

git fetch origin
git rebase origin/master

With collaborators:

git rebase origin/awesome-feature

Resolve any conflicts.

  1. When done, cleanup & merge

Cleanup:

git fetch origin
git rebase origin/master

Merge:

git checkout master
git pull origin master
git merge --no-ff awesome-feature
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment