Git rebase is most useful yet difficult to understand operation in git. Rebase helps one to keep commit history linear. This document explains what is rebase and how it affect commit history.
2. Purpose: Transplant range of commits
from another branch.
Alternatives: GiT merge
Disadvantage:
● Multi parent commit
● Good SCM policies should
NOT allow merge commit Push
GiT Rebase
6. Bring changes from master
As said earlier no merges please !!
option is transplant changes introduced in C-1 and
C-2 respectively.
Think rebase a cherry-pick over a range of
commits.
This keeps history linear and less graph traversal
cost.
Easier history to for human use.
7. Move topic branch as if it is created off
commit C-1
GiT Rebase
master
topic_branch
C-1 C-2
8. Move topic branch as if it is created off
commit C-2
GiT Rebase
master
topic_branch
C-1 C-2
9. Operational Notes.
Same merge conflict reappears:
In git command line use 'git rerere'
to save previous merge decisions.
Want to kill this rebase for now:
git rebase --abort