Relationship between n git branches

后端 未结 2 1442
北恋
北恋 2020-12-13 00:52

If I have n git branches, how do I easily show the relationship between these branches?

Basically I am interested in seeing a tree of a subset of al

相关标签:
2条回答
  • 2020-12-13 01:01

    I would use:

    gitk A C D
    

    ... there are probably other git GUIs that produce a prettier rendering of the commit graph, but I've always found gitk fine for this purpose. All the branches and tags are labelled in the "London Underground"-style representation:


    (source: mark at mythic-beasts.com)


    You can also use the --simplify-by-decoration option to gitk, since it understands all of the parameters that git rev-list does, for example:

    gitk --simplify-by-decoration A C D
    

    A screenshot of gitk with the --simplify-by-decoration option

    0 讨论(0)
  • 2020-12-13 01:23

    You can give this a try:

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

    It will only show commits that are branch heads or tagged.

    0 讨论(0)
提交回复
热议问题