What exactly does git pull --rebase do

What exactly happens when I run the command

git pull --rebase on the main branch

Does my story rewrite the branches of a master

Is this a good way to pull change or should we

 1. Git fetch 
 2. Git merge
+4
source share
1 answer

When you git pull --rebase, a few things will happen:

  • git fetch origin master

    - just use the source / master as an example

  • git rebase origin/master

    • moves all your commits after committing to start / master

At this point, you can click on the origin, and your commits will be applied on top of all other commits.

Without a flag, --rebaseyou get merge completion; one that has two parents: your main branch and work with the source / master

Here are some useful resources:

+2

Source: https://habr.com/ru/post/1547156/


All Articles