35

I read this but that did not explain Branch default. It would be nice to have a short explanation for all in one post. thank you

enter image description here enter image description here

Community
  • 1
  • 1
bastami82
  • 5,955
  • 7
  • 33
  • 44

1 Answers1

45

Merge: The result is identical with that of running git fetch ; git merge or git pull.
Rebase: The result is identical with that of running git fetch ; git rebase or git pull --rebase.
Branch Default: This option is to choose the default command for the branch applied. The default command is specified in the branch.<name> section of the .git/config configuration file.

Example: Assume the following history exists

  A---B---C topic
 /
D---E---F---G master

Merge:
If the current branch is "master"
Then "git merge topic" will replay the changes made on the topic branch since it diverged from master.Then the result of the following command:
git merge topic would be:

  A---B---C topic
 /         \
D---E---F---G---H master

Rebase:
If the current branch is "topic"
Then the commits that were in the "topic" branch are reapplied to the current branch, one by one, in order. Then the result of either of the following commands:
git rebase master or
git rebase master topic would be:

              A'--B'--C' topic
             /
D---E---F---G master

For further reference please refer the links below:
1.https://git-scm.com/docs/git-merge
2.https://git-scm.com/docs/git-rebase
3.https://www.jetbrains.com/idea/help/update-project-dialog-git.html?search=update%20projec

Moses
  • 916
  • 8
  • 14