创建并应用补丁

补丁是 Git 可以应用于一组文件的修改指令。

要从本地提交生成补丁文件:

  1. 转至Tools >Git >Local Repository
  2. 选择“Patch ” > “Create from Commits ”。
  3. 在对话框中选择用于生成补丁文件的提交。
  4. 选择“OK ”。

补丁文件将生成在本地仓库的根目录下,并遵循NNNN-提交标题.patch 的命名规则,其中NNNN是以0000 开头的四位数字。

要应用在“Qt Creator ”中打开的补丁文件,请转到“Tools ” > “Git ” > “Local Repository ”,然后选择“Patch ” > “Apply from Editor ”。

若要从文件系统中选择要应用的补丁文件,请选择“Apply from File ”。

若要应用剪贴板中的补丁,请选择“Apply from Clipboard ”。

另请参阅 《操作指南:使用 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.