I wanted to better understand these git procedures, so this project’s aim was to help me understand the differences and advantages of using git rebase
or git merge
.
I invented a fake project, and made commits, merges, and rebases as a simple mock of a potential portion of an actual project’s git repo.
The end result repos and git histories can be viewed in the respective repos for both merge and rebase. I did this as a learning exercise, so please give me feedback if I’ve misunderstood or poorly represented anything.
NOTES:
- I tried to follow the golden rule of rebasing
- When
merge
ing, I always used the--no-ff
flag in order to have a more verbose and clear commit history for comparison’s sake.
Fake Project Steps
- Boxes are user commits
- Circles are nodes where a merge or rebase action happens.
- Filled circles are required to be merges by the golden rule.
- Colors indicate branches
- black and red being the only branches tracked at origin.
Comparison of resulting commit histories
Links
Check the commit histories out for yourself:
- using rebase (golden rule applied)
- using merge