Search code examples
gitversion-controlbranchgit-branchvcs-checkout

how to check nesting structure of local git repository


I am working on a big product as a developer, I have many local branches, I wanted to visualize the git branch nesting workflow, i.e. say

master---------
     \
      \
      branch a--------
              \
               \
                branch child----

How can I get something like this I searched a lot but I found workarounds, which won't be useful in my case, like checking the complete log, etc, is there another way towards this issue.

Also previously another developer who left the company was working on the same pc and repo, so there are more than 50 branches so it's very essential for me to understand the workflow he was having in local


Solution

  • The closest way to view branches in a tree like structure is using the git log command.

    git log --graph --simplify-by-decoration --pretty=format:'%d' --all
    

    See this answer for more info on this.