git rebase
allows git rebase
to separate a branch from a blurry point and reconnect it to another branch. git merge
instead simply merges changes from another branch in the current branch, without restarting the story.
If there are no conflicts, the result is identical between merge and rebase, but the story is different:
(merge branch on master): master
In the first case, the merge creates a branch
, which merges into master
, which leads to the creation of the merge, E
In the second case, D
simply reboots to master
, creating an entther commit, D'
.
git pull --rebase
will pull the changes from the remote computer and also reinstall your changes on top of it. It will literally record your changes that are not on the remote control and play them back from the last change that he just selected.
source share