在此页面

提交

向 Git 提交修改

  1. 访问Tools >Git >Local Repository 并选择Commit

    Git 提交视图

    General Information 显示提交的版本库和分支名称。

  2. Commit Information 中,查看并编辑修改的作者信息。
  3. 要绕过预提交和提交消息钩子,请选择Bypass hooks
  4. 如果您的项目使用签注,请选择Sign off ,在提交日志信息末尾添加作者签注的预告片。
  5. Description 中,输入提交信息。
  6. Files 中,选择要包含在提交中的文件。
  7. 选择Diff Selected Files 打开 "Git Diff Files"视图,在该视图中,你可以逐块或逐行查看改动并对其进行阶段划分。
  8. 选择Commit 开始提交。

要查看当前分支的日志,请选择Branch 中的分支名称。

对文件应用操作

打开Files 中的上下文菜单,可对文件应用操作。Open in EditorShow in File System 等操作适用于所有文件。其他操作的可用性取决于所选文件的状态。

菜单项说明
Add将未跟踪的文件添加到版本控制中。
Stage提交已修改的文件。
Unstage取消提交修改过的文件。
Remove删除未跟踪文件。
Add to .gitignore将未跟踪文件添加到忽略列表。
Mark Untracked将添加的文件标记为未跟踪。
Revert Unstaged Changes to <file>将已修改文件中未缓存的更改还原为之前的状态。
Revert All Changes to <file>将已修改文件中的所有更改还原为之前的状态。
Recover <file>恢复从版本控制中删除的文件。
Run Merge Tool启动合并工具解决文件中的冲突。
Revert Renaming将重命名的文件还原为之前的名称。

解决冲突

要解决冲突,在冲突文件的上下文菜单中选择Run Merge Tool ,然后选择以下选项之一:

菜单项说明
Resolve by Recovering从版本控制中恢复已删除的文件。
Resolve by Removing从版本控制中删除文件。
Resolve Conflicts with Ours选择我们的文件版本来解决合并冲突。
Resolve Conflicts with Theirs选择他们的文件版本来解决合并冲突。
Mark Conflicts Resolved手动解决冲突后,将文件标记为已解决。

另请参阅 如何使用 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.