Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Rebases can be scary! They are all about rewriting your commit history. But it is a useful tool when working on your own branch in order to keep your branch clean and tidy.

...

Conceptually, a rebase is taking a branch and replaying the commits from that branch one-by-one onto the new 'base' set of commits. A visual demonstration:

Image RemovedImage Added

Info

The old commits are still there! The rebase merely creates new commits and updates the branch to point to the new ones. However, the old commits will disappear once git runs garbage collection unless there is another branch that still contains those commits.

...