git 分支
要使用 Git 分支,请访问Tools >Git >Local Repository 并选择Branches 。
Git Branches 视图会显示分支列表,以及本地分支与原始分支的区别。您签出的分支以粗体下划线显示。
过滤条目和标记
默认情况下,旧条目和标记会从分支列表中过滤掉。要包括它们,请选择 (Filter),然后选择Include Old Entries 和Include Tags 。
要为变更日志中的变更添加标记,请选择Branches >Log 。选择变更,然后在上下文菜单中选择Add Tag for <hash> 。
如果你签出了特定的提交,分支列表中会显示一个分离的 HEAD条目。
对于本地和远程分支,双击分支名称可查看变更日志。
要刷新分支列表,请选择 (Refresh)。
添加分支
要创建新的跟踪或非跟踪分支,请选择 (Add Branch)。
要在创建分支时签出该分支,请选择Checkout new branch 。
要跟踪所选分支,请选择Track local branch 。
管理分支
分支的上下文菜单具有以下功能:
菜单项 | 说明 |
---|---|
Add | 创建新的跟踪和非跟踪分支。 |
Remove | 删除本地分支。不能删除远程分支。 |
Rename | 重命名本地分支或标记。不能重命名远程分支。 |
Checkout | 签出所选分支并使其成为当前分支。你可以隐藏对跟踪文件所做的更改。 |
Diff | 显示所选分支与当前分支的差异。 |
Log | 显示分支中的更改。 |
Reset | 将活动分支重置为所选分支。你可以选择Hard 、Mixed 或Soft 重置。更多信息,请参阅git reset。 |
Merge | 将两个分支的开发历史合并到一起。 |
Rebase | 将本地提交复制到更新后的上游头。 |
Cherry Pick | 从选定的分支中挑选最重要的提交。 |
Track | 设置当前分支跟踪所选分支。 |
Push | 将已提交的变更推送到选定的远程分支。 |
远程分支的上下文菜单有以下附加功能。要打开它,请选择Remote Branches 或远程版本库。
菜单项 | 说明 |
---|---|
Fetch | 从特定远程仓库获取所有分支和更改信息,如果应用于Remote Branches ,则从所有远程仓库获取。 |
Manage Remotes | 打开Remotes 对话框。 |
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.