Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 665713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:44:20+00:00 2026-05-13T23:44:20+00:00

Right now, when I type git branch it lists my branches in an arbitrary

  • 0

Right now, when I type “git branch”

it lists my branches in an arbitrary order.

What I would prefer would be if “git branch” listed my output in a tree like fasion, somethign like:

master
|-- foo
  |-- foo1
  |-- foo2
|-- bar
  |-- bar4

Where here, foo & bar were branched from master; foo1 & foo2 were branched from foo; bar4 was branched from bar.

Is this easy to accomplish?

[Command line utilities only. This needs to fit into my zsh/vim workflow.]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:44:20+00:00Added an answer on May 13, 2026 at 11:44 pm

    The answer below uses git log:

    I mentioned a similar approach in 2009 with “Unable to show a Git tree in terminal“:

    git log --graph --pretty=oneline --abbrev-commit
    

    But the full one I have been using is in “How to display the tag name and branch name using git log –graph” (2011):

    git config --global alias.lgb "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset%n' --abbrev-commit --date=relative --branches"
    
    git lgb
    

    Original answer (2010)

    git show-branch --list comes close of what you are looking for (with the topo order)

    --topo-order
    

    By default, the branches and their commits are shown in reverse chronological order.
    This option makes them appear in topological order (i.e., descendant commits are shown before their parents).

    But the tool git wtf can help too. Example:

    $ git wtf
    Local branch: master
    [ ] NOT in sync with remote (needs push)
        - Add before-search hook, for shortcuts for custom search queries. [4430d1b] (edwardzyang@...; 7 days ago)
    Remote branch: origin/master (git@gitorious.org:sup/mainline.git)
    [x] in sync with local
    
    Feature branches:
    { } origin/release-0.8.1 is NOT merged in (1 commit ahead)
        - bump to 0.8.1 [dab43fb] (wmorgan-sup@...; 2 days ago)
    [ ] labels-before-subj is NOT merged in (1 commit ahead)
        - put labels before subject in thread index view [790b64d] (marka@...; 4 weeks ago)
    {x} origin/enclosed-message-display-tweaks merged in
    (x) experiment merged in (only locally)
    
    NOTE: working directory contains modified files
    

    git-wtf shows you:

    • How your branch relates to the remote repo, if it’s a tracking branch.
    • How your branch relates to non-feature (“version”) branches, if it’s a feature branch.
    • How your branch relates to the feature branches, if it’s a version branch
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now my ant task looks like. <javadoc sourcepath=${source} destdir=${doc}> <link href=http://java.sun.com/j2se/1.5.0/docs/api/ /> </javadoc>
Right now I'm doing something like this: RewriteRule ^/?logout(/)?$ logout.php RewriteRule ^/?config(/)?$ config.php I
Right now, I have code that looks something like this: Private Sub ShowReport(ByVal reportName
I have a button which right now is set as a type submit. This
I am using this ccode right now.. <%using (Html.BeginForm(SaveNewServiceTypeCategory,ServiceTypeCategory)){ %> <table> <tr> <td>Service type
Right now, I keep all of my projects on my laptop. I'm thinking that
Right now, I'm particularly interested in reading the data from MP3 files (ID3 tags?),
Right now I have a database (about 2-3 GB) in PostgreSQL, which serves as
Right now I have an SSIS package that runs every morning and gives me
Right now I'm making an extremely simple website- about 5 pages. Question is if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.