Does git attraction do merge creation?

Does git pull always create merge?

If I have a function branch that I am updating with git pull -r . master git pull -r . master , and then switch to master and do git pull . feature-branch git pull . feature-branch , I don't think I'm getting a merge command.

+2
git
source share
1 answer

You have a good example about git merge and fast forward on a linked website.

@MicroVirus gave a good explanation. Below, the gray dot is the HEAD of your local HEAD before extraction (fetch + merge). You can see the difference between the two methods of merging.

git fast forward
(source: ofilabs.com )

Another way to update a repo with git pull is to use the --rebase option. This option applies your commits at the top of the branch, rewriting the story. You can read the details there . People are divided between using git pull or git pull --rebase . In my opinion, rebase should be used to fix the error, instead of the classic traction, it should be used when a new function is combined with master.

Git ReBase Example git rebase example

Read the link below to get an idea of ​​the different points of view:

  • git pull VS git fetch + git rebase

  • Difference between git pull and git pull --rebase

+3
source share

All Articles