Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merge or Rebase or Branch Default In Android Studio? What are the differences?

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

like image 367
bastami82 Avatar asked Nov 02 '15 17:11

bastami82


1 Answers

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

like image 118
Moses Avatar answered Sep 22 '22 02:09

Moses