The difference of merge and rebase
rebase
rebase process
<!-- state -->
feature S01 and S02 created in node A(dev)
SO1 commit once and in node B
S02 commit once and in node C
<!-- opeartion -->
check in S02 and rebase S01 to S02
it seems that S02 created in node B rather than A
then C
before
S02 A -> C
now
S02 A -> B -> C'
diff
- merge will always generate a ‘merge’ commit () when –no-ff
but rebase will not, it seems that fast-forward every time - rebase means that updates current up stream, then changes current commits
- ‘merge’ commits is easier to distinguish when update upstream and rolling back is easier.
However, the merge commit that dev is merged to feature looks complex.
roll back
git checkout mybranch # if needed
git reset --hard ooooooo # or mybranch@{1}
stackoverflow.com/undoing-a-git-rebase
stackoverflow.com/undo-git-rebase
recommend
merge is recommend because when co-work, the ‘merge’ commits is easier to distinguish which feature