Merge does, as the name suggests, it merges two development branches into one. So, imagine that you have a main branch on the M1 commit. Then you work on your notebook and create the commit N. And also you work on your desktop and create the commit L:
N / M1-L
When you merge N into L, you merge the changes and get a new commit M2
N / \ M1-L-M2
This saves all the changes as they were made, but you get these little double paths that can become quite confusing, especially if you have a lot of them.
Then there is rebase. Starting from the same situation, rebasing takes one of the N or L commits and pretends that it was made after the other. This leads to a new commit n '
M1-LN'
N 'and M2 have the same content, just their story looks different.
While you're alone
It does not matter. You will have current status in both directions.
If you are a team
The difference becomes important:
When you rebase branch that someone has already pulled, it can see some confusing effects, because the branch that it was working on suddenly contains completely different commits.
Thus, you do not want to advertise things that have become public.
On the other hand, if you have 10 commit and merge developers, like in hell, the story becomes confusing and you might prefer the developers to work on private repositories and then rebase to push before the integration branch.
source share