They have one difference:
- Rebase will rewrite the commit history (log) to make it linear
- while merge will not.
- A - B - C - D - remote HEAD \ E - F - G - local HEAD
After a merge, the commit history (log) will look like:
- A - B - C - D - remote HEAD \ \ E - F - G - local HEAD - new local HEAD
After a rebase, the commit history (log) will look like:
- A - B - C - D - remote HEAD - E' - F' - G' - local HEAD'
Advantage / Disadvantage
There is a trade-off:
- The advantage of a rebase is that the history is easier to follow.
- The disadvantage is that the code in commit G may not work nicely with the code in commit B.