本页内容

暂存更改

将更改添加到暂存区以便提交,这样您就可以将它们推送到远程仓库或发送至 Gerrit 进行审核。

将当前文件加入暂存

要将新文件或已修改的文件标记为提交到仓库,请通过以下任一方式将其添加到暂存区:

  • 转到“Tools ” > “Git ” > “Current File ”,然后选择“Stage <file> for Commit ”。
  • “项目”或“文件系统”中右键单击该文件,然后选择“Git ” > “Stage ”。
  • 转到“Tools ” > “Git ” > “Local Repository ” > “Commit ”,在“Files ”中右键单击该文件,然后选择“Stage ”。

取消暂存当前文件

若要将当前文件从已暂存的更改中移除,请通过以下任一方式将其从暂存区移出:

  • 转到“Tools ” > “Git ” > “Current File ”,然后选择“Unstage <file> from Commit ”。
  • “项目”或“文件系统”中右键单击该文件,然后选择“Git ” > “Unstage ”。
  • 转到“Tools ” > “Git ” > “Local Repository ” > “Commit ”,在“Files ”中右键单击该文件,然后选择“Unstage ”。

将代码块或行添加到暂存区

Git Diff视图中,您可以按块或按行将更改加入暂存,以便提交。

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