在 Git 中可视化分支拓扑 [英] Visualizing branch topology in Git

查看:18
本文介绍了在 Git 中可视化分支拓扑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在自己的机器上孤立地使用 Git,我发现很难维护我所有分支和提交的心智模型.我知道我可以做一个 git log 来查看我所在位置的提交历史,但是有没有办法查看整个分支的地形,比如这些 ASCII 映射,这些映射似乎无处不在用于解释分支?

I'm playing with Git in isolation on my own machine, and I find it difficult to maintain a mental model of all my branches and commits. I know I can do a git log to see the commit history from where I am, but is there a way to see the entire branch topography, something like these ASCII maps that seem to be used everywhere for explaining branches?

      .-A---M---N---O---P
     /     /   /   /   /
    I     B   C   D   E
        /   /   /   /
      `-------------'

感觉就像有人走过来试图拿起我的存储库很难弄清楚到底发生了什么.

It just feels like someone coming along and trying to pick up my repository would have difficulty working out exactly what was going on.

我想我受到了 AccuRev 的流浏览器...

I guess I'm influenced by AccuRev's stream browser...

推荐答案

使用 git log --graphgitk.(两者都接受 --all,这将显示所有分支,而不仅仅是当前分支.)

Use git log --graph or gitk. (Both also accept --all, which will show all the branches instead of just the current one.)

对于分支名称和紧凑视图,请尝试:

For branch names and a compact view, try:

git log --graph --decorate --oneline

这篇关于在 Git 中可视化分支拓扑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆