Showing branch hierarchy at the command line?

后端 未结 6 1657
攒了一身酷
攒了一身酷 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:28

    sehe's solution looks great, here is another one that seems to contain similar information, formatted differently, it uses git log, so it contains commit information as well (ignore the branch names, I kind of messed them up!):

    git log --all --graph --decorate --oneline --simplify-by-decoration
    
    * ae038ad (HEAD, branch2-1) add content to tmp1
    | * f5a0029 (branch2-1-1) Add another
    |/  
    * 3e56666 (branch1) Second wave of commits
    | * 6c9af2a (branch1-2) add thing
    |/  
    * bfcf30a (master) commit 1
    

提交回复
热议问题