Skip to content

Instantly share code, notes, and snippets.

@philikon
Created August 2, 2010 16:00
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philikon/504847 to your computer and use it in GitHub Desktop.
Save philikon/504847 to your computer and use it in GitHub Desktop.
# Start a new chapter by branching the current branch off:
(branch chapter5)$ git checkout -b chapter6
# Make some commits:
(branch chapter6)$ git commit
(branch chapter6)$ git commit
# Oh noez, chapter 3 needs a bugfix
(branch chapter6)$ git checkout chapter3
(branch chapter3)$ git commit -m "Bugfix"
# Rebase all later chapters on chapter 3.
(branch chapter3)$ git checkout chapter4
(branch chapter4)$ git rebase chapter3
(branch chapter4)$ git checkout chapter5
(branch chapter5)$ git rebase chapter4
# Oh noez, rebasing chapter5 on chapter4 got us a conflict in file 'foo.py'.
# First resolve manually, then continue rebasing.
(branch chapter5)$ emacs foo.py
(branch chapter5)$ git add foo.py
(branch chapter5)$ git rebase --continue
# Continue rebasing newer chapters
(branch chapter5)$ git checkout chapter6
(branch chapter6)$ git rebase chapter5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment