Git UndoLesson 37Free preview
Git Rebase
This lesson is part of Git · All levels
Summary
Rebase moves the commit range to the base of another branch so that the history looks linear and neat. The golden rule: don't revise commits that have already been shared with the public because it creates new commits with different hashes. Interactive rebase with git rebase -i allows rearranging, merging, or editing commits.
Key points
- Rebase reattached the commit to the latest commit target
- Don't rebase commits that have already been published.
- Git rebase -i opens the editor to rearrange commit
- Squash commands bring together several commits into one.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.