版本分支图

版本分支图

图 5.46. 一个版本分支

一个版本分支

有时候,我们需要知道从哪开始有了分支和标签,同时想知道这条支路是单独的分支还是树型结构。如果需要你可以使用TortoiseSVN → 版本分支图...。

这个版本历史分析图能够显示分支/标签从什么地方开始创建,以及什么时候删除。

重要

In order to generate the graph, TortoiseSVN must fetch all log messages from the repository root. Needless to say this can take several minutes even with a repository of a few thousand revisions, depending on server speed, network bandwidth, etc. If you try this with something like the Apache project which currently has over 500,000 revisions you could be waiting for some time.

The good news is that if you are using Log Caching, you only have to suffer this delay once. After that, log data is held locally. Log caching is enabled in TortoiseSVN's settings.

版本图节点

The revision graph shows several types of node:

增加文件/文件夹

已增加或通过复制生成的文件/文件夹以圆圈的方式标记。

已删除文件/文件夹

已删除文件,比如说一个不在需要的分支,将显示octagon(rectangle with corners cut off)。

分支最新版本

Where a branch (or trunk or tag) has been modified since the last branch node, this is shown using an ellipse. Shown when the Show HEAD revisions option is selected.

一般的文件/文件夹

其他一般的文件用plain rectangle标示。

Note that by default the graph only shows the points at which items were added or deleted. Showing every revision of a project will generate a very large graph for non-trivial cases. If you really want to see all revisions where changes were made, there is an option to do this in the View menu and on the toolbar.

Changing the View

因为版本图经常很复杂,所以有很多方法剪裁视图。你可以在视图菜单或工具栏找到它们。

分组分支

The default behavior (grouping off) will use one row per revision and all rows are sorted strictly by revision. As a result, long-living branches occupy a whole column for only a few changes and the graph becomes very broad.

This mode groups changes by branch, so that there is no global revision ordering: Consecutive revisions on a branch will be shown in (often) consecutive lines. Sub-branches, however, are arranged in such a way that later branches will be shown in the same column above older branches to keep the graph slim. As a result, a given row may contain changes from different revisions.

最老的在顶部

正常情况下,在图形底部显示最老的版本,版本树向上生长。使用这个选项,版本树从顶部向下生长。

显示最新版本

它确保每个分支的最新版本永远在图中显示。

精确复制源

When a branch/tag is made, the default behaviour is to show the branch as taken from the last node where a change was made. Strictly speaking this is inaccurate since the branches are often made from the current HEAD rather than a specific revision. So it is possible to show the more correct (but less useful) revision that was used to create the copy.

折叠标签

If you want to see a graph of software development, tagged releases may be of little interest to you. This option hides the nodes for tags and shows them instead in the tooltip for the node that they were copied from. A tag icon on the right side of the source node indicates that tags were made.

减少交叉行

如果图形布局产生许多交叉行,可使用这个选项来清理。它可以让布局列在更少的逻辑位置显示,例如使用斜线而不是列,可能需要少许时间来优化显示。

过滤器

Sometimes the revision graph contains more revisions than you want to see. This option opens a dialog which allows you to restrict the range of revisions displayed, and to hide particular paths by name.

使用图

概览窗口可以使遍历大图更容易。它在小窗口中显示整个图形,高亮显示当前详细显示的部分。你可以通过拖曳高亮区域来改变当前详细显示的部分。

任何时候只要鼠标在版本框上滑过,都会显示该版本的日期、作者和备注信息。

If you select two revisions (Use Ctrl-left click), you can use the context menu to show the differences between these revisions. You can choose to show differences as at the branch creation points, but usually you will want to show the differences at the branch end points, i.e. at the HEAD revision.

你可以用查看单一差异文件的方式来查看差异,它在单一的文件中显示差异。如果你选右键菜单 → 比较版本所有修改过的文件都会呈现在列表中。双击一个文件名可以返回文件版本号和他们差异。

如果右击一个版本你可以使用右键菜单 → 显示日志 来查看它的历史。

You can also merge changes in the selected revision(s) into a different working copy. A folder selection dialog allows you to choose the working copy to merge into, but after that there is no confirmation dialog, nor any opportunity to try a dry run. It is a good idea to merge into an unmodified working copy so that you can revert the changes if it doesn't work out! This is a useful feature if you want to merge selected revisions from one branch to another.

小心

因为Subversion不能支持提供所有请求的信息,在有大量请求信息时,有时它能提供强大的返回信息。但无论如何,主干都会产生有用的输出。

刷新视图

If you want to check the server again for newer information, you can simply refresh the view using F5. If you are using the log cache (enabled by default), this will check the repository for newer commits and fetch only the new ones. If the log cache was in offline mode, this will also attempt to go back online.

If you are using the log cache and you think the message content or author may have changed, you should use the log dialog to refresh the messages you need. Since the revision graph works from the repository root, we would have to invalidate the entire log cache, and refilling it could take a very long time.

转载于:https://www.cnblogs.com/mingyongcheng/archive/2011/03/22/1991707.html

<think>我们使用的是Git,小乌龟指的是TortoiseGit,它是一个Git的图形化客户端。在TortoiseGit中查看版本分支图(也称为提交图或历史图)的步骤如下:1.在资源管理器中,右键点击你的工作目录。2.选择“TortoiseGit”->“显示日志”。3.在打开的日志窗口中,点击工具栏上的“查看”按钮(可能显示为“View”),然后选择“显示所有分支在图中”或者直接点击“分支图”按钮(通常是一个分支的图标)。这样就会显示一个可视化的分支图,其中会展示所有的提交、分支、标签以及它们之间的关系。但是,如果你想要通过命令行来查看分支图,可以使用`gitlog`命令配合`--graph`选项。以下是一个使用`gitlog`来查看分支图的例子:```bashgitlog--oneline--graph--all```解释:-`--graph`:以文本形式绘制提交历史的分支图。-`--oneline`:每个提交只显示一行(缩略提交信息)。-`--all`:显示所有分支的提交历史。示例输出:```*a1b2c3d(HEAD->master)Mergebranch'feature'|\|*d4e5f6a(feature)Addnewfeature|*e7f8g9hStartfeature|/*b2c3d4eFixbug*c3d4e5fInitialcommit```在TortoiseGit的图形界面中,分支图会更加直观,使用不同的颜色和线条来表示分支和合并。如果你想要在TortoiseGit中更清晰地看到分支结构,可以调整视图设置,例如:-勾选“显示所有分支在图中”以查看所有分支。-可以通过拖拽节点来重新排列图形,使其更易读。-可以右键点击某个提交,选择“标记此提交”来高亮显示。此外,TortoiseGit还支持在分支图中查看特定分支、标签或提交范围的历史。下面是一个简单的示例,展示如何在TortoiseGit中查看分支图:步骤:1.在项目文件夹中右键单击,选择“TortoiseGit”->“显示日志”。2.在日志窗口的顶部工具栏,点击“分支图”按钮(通常是一个有分支结构的图标)。3.如果视图不够清晰,可以尝试在“查看”菜单中调整显示选项,比如“显示所有分支在图中”。注意:如果项目历史非常复杂(有大量的分支和合并),图形化显示可能会变得拥挤,这时可以尝试使用过滤功能(例如按分支、作者、日期等过滤)来简化视图。相关问题:§§相关问题§§:1.如何在Git命令行中查看分支合并图?2.TortoiseGit中如何比较两个提交之间的差异?3.如何解决TortoiseGit分支图中显示过于拥挤的问题?4.在TortoiseGit中如何查看特定分支的提交历史?</think>### 小乌龟版本分支图查看指南(TortoiseGit) 小乌龟(TortoiseGit)是Windows系统下最流行的Git图形化工具之一,其分支图功能可以直观展示项目的版本历史、分支结构和提交关系。以下是详细的使用方法和技巧: #### 查看分支图的完整步骤 1. **打开分支图界面** ```mermaid graph LR A[在项目文件夹右键] --> B[选择 TortoiseGit] B --> C[点击 显示日志] C --> D[点击工具栏 分支图图标] ``` 2. **关键界面元素说明** ```mermaid graph TD A[分支图界面] --> B[提交节点] A --> C[分支标签] A --> D[合并线] A --> E[HEAD指针] A --> F[标签标记] ``` #### 分支图符号详解 | 符号 | 含义 | 示例 | |------|------|------| | ● | 普通提交 | `● c1a2b3` | | ◯ | 合并提交 | `◯ m5e6f7` | | ─ | 主分支线 | `───●───●` | | ├─ | 分支起点 | `├─● dev-branch` | | ─┬─ | 合并点 | `─┬─● merge` | | ▲ | HEAD指针 | `● ▲ HEAD` | | ⚑ | 标签 | `● v1.0 ⚑` | #### 高级查看技巧 1. **过滤显示内容** ```mermaid graph LR A[右键空白处] --> B[筛选日志] B --> C[按分支过滤] B --> D[按作者过滤] B --> E[按日期过滤] ``` 2. **查看提交详情** - 双击提交节点:查看完整提交信息 - 右键提交节点: ```mermaid graph LR A[右键菜单] --> B[查看差异] A --> C[回滚提交] A --> D[创建标签] A --> E[创建分支] ``` 3. **分支图导航技巧** ```python # 快捷键操作 Ctrl + 鼠标滚轮 # 缩放视图 鼠标拖动 # 平移视图 空格键 # 重置视图位置 ``` #### 实际分支图示例分析 ```mermaid gitGraph commit id: "1" commit id: "2" branch dev checkout dev commit id: "3" commit id: "4" checkout main commit id: "5" merge dev id: "6" commit id: "7" branch feature checkout feature commit id: "8" checkout main commit id: "9" ``` 对应TortoiseGit显示效果: ``` ● 9 (main) ▲ HEAD ● 8 (feature) | ● 7 (main) | ◯ 6 Merge dev into main | |\ | | ● 4 (dev) | | ● 3 | |/ ● 5 ● 2 ● 1 ``` #### 分支图解读要点 1. **分支创建点**: - `branch dev` 表示在提交2后创建了dev分支 - 垂直线表示分支发展路径 2. **合并操作**: - 提交6是合并提交(◯ 符号) - 合并线 `|\` 和 `|/` 显示合并来源 3. **HEAD位置**: - ▲ 符号标记当前检出的提交 - `(main)` 表示当前在main分支 4. **并行开发**: - feature分支从提交7创建 - 与main分支并行开发 #### 常见问题解决方案 1. **分支图显示混乱**: ```mermaid graph LR A[问题] --> B[分支线交叉] A --> C[节点堆叠] B --> D[使用 查看 > 拓扑排序] C --> E[调整 视图 > 布局] ``` 2. **查找特定提交**: - 使用搜索框:按提交ID/作者/消息搜索 - 快捷键:Ctrl+F 3. **比较分支差异**: ```mermaid graph LR A[选中两个分支] --> B[右键选择] B --> C[比较分支] C --> D[显示差异文件列表] ``` #### 最佳实践建议 1. **分支管理规范**: ```mermaid graph LR main -- 发布版本 --> release/v1.0 main -- 功能开发 --> feature/login main -- 问题修复 --> hotfix/issue-123 ``` 2. **提交消息规范**: - 类型前缀:`feat: `, `fix: `, `docs: ` - 关联issue:`#123` - 示例:`fix: resolve login timeout #456` 3. **定期清理分支**: - 合并后立即删除已完成的分支 - 使用分支图识别陈旧分支
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值