本页内容

git merge

要将两个分支的开发历史合并在一起,请转到“Tools ” > “Git ” > “Local Repository ”,然后选择“Branches ”。

在“Git Branches ”视图中,右键单击一个远程分支,然后在上下文菜单中选择一个合并选项。如果通过追溯第一个提交的历史可以到达您要合并的提交,则没有需要合并的分歧工作。 若要允许 Git 将分支指针向前移动,请选择“Merge <remote branch> into <local branch> (Fast-Forward) ”。若不希望对分支进行快进合并,请选择“Merge <remote branch> into <local branch> (No Fast-Forward) ”。

配置合并工具

仅支持图形化合并工具。您可以在命令行中配置要使用的合并工具。例如,要使用KDiff3合并工具,请输入以下命令:

git config --global merge.tool kdiff3

另请参阅 《如何:使用 Git》和《使用 Git》。

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.