git 在 Android Studio 中合并、变基或分支默认值?有什么区别?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33483716/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 11:29:22  来源:igfitidea点击:

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

androidgitandroid-studio

提问by bastami82

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

我读了这个,但这并没有解释 Branch 默认。在一篇文章中对所有内容进行简短解释会很好。谢谢你

enter image description hereenter image description here

enter image description hereenter image description here

回答by Moses

Merge:The result is identical with that of running git fetch ; git mergeor git pull.
Rebase:The result is identical with that of running git fetch ; git rebaseor 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/configconfiguration file.

合并:结果与运行git fetch ; git merge或的结果相同git pull
Rebase:结果与运行git fetch ; git rebase或的结果相同git pull --rebase
分支默认:此选项是为应用的分支选择默认命令。默认命令branch.<name>.git/config配置文件的部分中指定。

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 topicwould be:

合并:
如果当前分支是“master”,
那么“git merge topic”将重放在主题分支上所做的更改,因为它从master分支出来。那么以下命令的结果:
git merge topic将是:

  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 masteror
git rebase master topicwould be:

Rebase:
如果当前分支是“主题”,
那么“主题”分支中的提交将按顺序重新应用到当前分支。那么以下任一命令的结果:
git rebase master
git rebase master topic将是:

              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

如需进一步参考,请参阅以下链接:
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