我一直在提出我的 Psgraph.. 模块到几个 电源外壳用户组。我在我的演示中做的一件事是使用本地系统信息来生成图表。像网络连接和过程关系一样的东西。其中一些结果是非常有用的。所以我已经开始将它们编译成一个名为的新模块 psgraphplus..
One of the commands that I find myself running all the time from this module is Show-Gitgraph..
. I spent today working on it and I would like to share my progress.
#指数
git作为定向图
Git为Psgraph创建一个很好的例子,因为它已经是定向图。每次提交都有一个或多个父级提交。每个分支只能指向特定的提交。我们只需映射出来。
这看起来很像你在git帮助指南中看到的图表。这一个分支和几个提交。
Show-Gitgraph..
If you want to generate graphs like that for your Git repository, you can use Show-Gitgraph..
to do so. Let’s take a look at an example from a real repository.
Show-Gitgraph.. -Depth 5
通过指定5的深度,它将只显示5个最新的提交。黄色框是我的v1.2发布的标签。第一个绿色盒子是一个远程功能分支,我合并到掌握但从未清理过。最后两个绿色框显示我的本地和远程主分支指向相同的提交。灰色框表示我已被检查过的当前分支。
功能列表
Here is a quick overview of the Sho-GitGraph
parameters and features.
-Depth
配置历史历史数量-Direction
to change the direction of the graph.TopToBottom
orLeftToRight
- 标签以黄色列出
- 本地和偏远的绿色分支
- 显示不在当前分支机构Git Log中的姐妹分支
- 灰色的当前位置
-ShowCommitMessage
显示提交消息
更多例子
You can see many of those in action on the graph above. I also want to show you the same graph with a TopToBottom
direction and the -ShowCommitMessage
.
Show-Gitgraph.. -Depth 5 -ShowCommitMessage -Direction TopToBottom
我知道那里有很多工具可以做一个更好的工作探索提交历史,但我发现它在我的指尖下有这个命令。
这是最后一块糖果,让你离开。
安装psgraphplus.
此模块构建在我的PSGraph模块上。因此,您需要首先安装PSGraph和GraphViz。从PowerShell 5.0管理提示运行这些下一个命令以安装所需的所有内容。
# Install GraphViz from the Chocolatey repo
Register-PackageSource -Name Chocolatey -ProviderName Chocolatey -Location http://chocolatey.org/api/v2/
Find-Package graphviz | Install-Package -ForceBootstrap
# Install from the Powershell Gallery
Find-Module PSGraph -Repository PSGallery | Install-Module
Find-Module PSGraphPlus -Repository PSGallery | Install-Module
当我发现良好的东西到图表时,我将继续向该模块添加更多命令。如果你想出一个你觉得应该包括的好主意,请告诉我。我很想听到它。