Showing branch hierarchy at the command line?

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

    Try

    git show-branch
    git show-branch --all
    

    Example output:

    bash$ git show-branch --all
    ! [branchA] commitA only in branchA
     * [branchB] commitB
      ! [branchC] commitC only in branchC
    ---------------------
    +   [branchA] commitA only in branchA 
     *  [branchB] commitB
      + [branchC] commitC only in branchC
     *+ [branchC~1] commitB-1 also in branchC
     *+ [branchC~2] commitB-2 also in branchC
    +++ [branchC~3] common ancestor
    +++ [branchC~4] more common ancestors
    

提交回复
热议问题