docs:git:rebase

FIXME rebase allows you to do several things, one of which is to take a group of commits, rewrite history, and organize them into a lumped commit. This is great for when a developer has done his own thing with branches and many small commits, but wants to publish one nice clean commit of the work onto a public repository.

  • start a rebase operation in interactive mode, for the latest 5 commits
    git rebase -i HEAD~5
  • your text editor will be started, showing you a list of the commits within the specified scope, and instructions listed at the bottom
  • edit this file as necessary per the instructions, then save it and exit your editor
  • if the rebase fails or your decide not to go through with it, you need to abort
    git rebase -i --abort
  • if you need to fix something from a conflict, you can continue the operation
    git rebase -i --continue
  • docs/git/rebase.txt
  • Last modified: 2009/10/21 23:14
  • by billh