设置版本控制系统
Qt Creator 使用版本控制系统的命令行客户端访问版本库。请确保命令行客户端位于 环境变量中,或在PATH
偏好设置> 的版本控制系统特定选项卡中指定命令行客户端可执行文件的路径。Version Control
其他配置选项取决于版本控制系统。设置好版本控制系统后,使用命令行检查是否一切正常(例如,使用 status 命令)。如果没有出现问题,就可以从Qt Creator 开始使用该系统了。
有关 Windows 版 Git 的更多信息,请参阅使用 Windows 版 Git。
一般 VCS 偏好设置
进入首选项>Version Control >General ,指定提交消息的设置:
- Wrap submit messages at 将提交信息的行长限制为指定的字符数。
- Submit message check script 是一个脚本或程序,在提交前对提交信息进行检查。提交信息是脚本的第一个参数。如果出现错误,脚本应在标准错误中输出一条信息,并返回一个非零的退出代码。
- User/alias configuration file 是一个文本文件,以邮件地图格式列出作者姓名。您必须为每位作者指定真实姓名和电子邮件地址,还可选择别名和第二个电子邮件地址。例如
Jon Doe <Jon.Doe@company.com> jdoe <jdoe@somemail.com> Hans Mustermann <Hans.Mustermann@company.com> hm <info@company.com>
在此字段中指定文件后,您可以在Nicknames 对话框中选择作者作为提交信息字段的值。
- User fields configuration file 是一个简单的文本文件,由指定以作者为值的提交信息字段的行组成,例如
Acked-by: Initial-patch-by: Reported-by: Rubber-stamped-by: Signed-off-by: Tested-by:
在此字段中指定文件后,就可以在提交更改时将作者添加为提交信息字段的值。如果还指定了User/alias configuration file ,则可以在Nicknames 对话框中选择作者。
- SSH prompt command 指定一个 ssh-askpass 命令,在使用 SSH 时可以使用该命令(在 Linux 上)提示用户输入密码。例如, 或 ,取决于您使用的 ssh-askpass 实现。
ssh-askpass
x11-ssh-askpass
- Reset VCS Cache 例如,从命令行更改版本控制系统配置后,将其重置为 已知的状态。Qt Creator
在项目中显示文件状态
从文件请求文件状态更新并在项目中显示可能会降低Qt Creator 的运行速度。
要显示文件状态,请访问首选项>Version Control >General ,然后选择Show VCS file status 。
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.