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
Merge or Rebase or Branch Default In Android Studio? What are the differences?
提问by bastami82
回答by Moses
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.
合并:结果与运行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 topic
would 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 master
or git rebase master topic
would 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