Showing branch hierarchy at the command line?

后端 未结 6 1741
攒了一身酷
攒了一身酷 2021-01-29 23:53

I\'m curious if there is a way to show branch hierarchy on the command line? For instance if I use git branch, instead of seeing output like this:

*         


        
6条回答
  •  感动是毒
    2021-01-30 00:35

    How about this alias for your .gitconfig:

    [alias]
    branch-tree = !cd "$(git rev-parse --git-dir)/refs/heads" && tree
    

    You can also give options, depending on what your tree command supports, such as -D for timestamps.

提交回复
热议问题