01 Merging VS rebasing

Result of the rebase command looks much like that of the merge. The style branch currently contains all its changes, plus all the changes of the master branch. The commit tree, however, is a bit different. The style branch commit tree has been rewritten to make the master branch a part of the commit history. This makes the chain of commits linear and more readable.

02 When to use the rebase, when the merge?

Don’t use the rebase command …

If the branch is public and shared. Rewriting such branches will hinder the work of other team members.

When the exact commit branch history is important (because the rebase command rewrites the history of commits).

Given the above recommendations, I prefer to use rebase for short-term, local branches and the merge command for branches in the public repository.