gpt4 book ai didi

git - 仅可视化 git 分支拓扑,没有提交历史

转载 作者:行者123 更新时间:2023-12-04 01:30:14 25 4
gpt4 key购买 nike

我想简单地查看我的 git 存储库的分支拓扑,而不是同时可视化整个提交历史,这使得分支可视化难以阅读。

例如,这是我按照给定的命令得到的结果 here

$ git log --graph --full-history --all --pretty=format:"%h%x09%d%x20%s"
* 822458d (HEAD -> branch2) revision 5
* 1057127 revision 4
| * ae46e7e (branch1a) revision 3
| * 39cd7e2 (branch1) revision 2
| * 6802061 revision 1
|/
* f8c8522 (master) start

虽然我想要的只是分支的拓扑结构,但没有提交历史记录,即像这样的东西
branch2
| branch1a
| /
| branch 1
|/
(master)

你们知道如何在git中实现这一目标吗?

谢谢你。

最佳答案

git log --all --decorate --oneline --graph --simplify-by-decoration

The --simplify-by-decoration option allows you to view only the big picture of the topology of the history, by omitting commits that are not referenced by tags. Commits are marked as !TREESAME (in other words, kept after history simplification rules described above) if (1) they are referenced by tags, or (2) they change the contents of the paths given on the command line. All other commits are marked as TREESAME (subject to be simplified away).

关于git - 仅可视化 git 分支拓扑,没有提交历史,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51838290/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com