33

I use the Git Flow workflow. But I can't generate a good-looking log in tree graph. The size is too small and won't show all the branch relationships like in the Git Flow chart.

How can I create a graph like this for my Git repository?

This is how Tower shows it.

2
  • 1
    Asking for tool recommendations is not encouraged. In essence, are you asking how to create a log that resembles the Git Flow graph? Do you need this via git log or a graphical tool? Have you seen Visualizing branch topology in git?
    – slhck
    Jan 9, 2014 at 8:43
  • The utility I use is tig. But that’s just a terminal utility that shows branches; it won’t paint any fancy images (graphviz or other). Jan 3, 2023 at 15:42

4 Answers 4

22

You have not specified whether you are looking for a command line tool or not, but if so, I find that something like this gives you a good appreciation of the branch structure

git log --all --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

And of course you can create an alias for this with git config, eg

git config --global alias.lg "log --all --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
1
6

I suggest you to use GitKraken to get such images.
It is a Git GUI client for Windows, Mac and Linux.
In it you have a nice visuals like the Commit History.

GitKraken

There are more Git GUIs, such as:

SourceTree, available for free for Windows and MacOS.

Tower

Here's a list of them from Git's official website and a list of them from Wikipedia that may be of help.

0
5

If your code is in a public github repo, you might want to look at http://beta.gitflowchart.com. For Atlassian Stash, there is a plugin that does this too (not free).

Disclosure: I wrote the underlying library for both tools.

5
  • I wanted to give beta.gitflowchart.com a try, but it asking for too many permissions for me to be comfortable with: "This application will be able to read and write all public repository data. This includes the following:". Why is it requesting write access to everything?
    – AdamRalph
    Jul 28, 2015 at 5:33
  • @AdamRalph: yes, that is unfortunate. If you request access to a users data, you pass in a scope. This is defined here: developer.github.com/v3/oauth/#scopes I'm not sure what the correct way of requesting only read access to your public repos would be. Please take my word that we will only read your data and not change anything.
    – Teun D
    Jul 28, 2015 at 6:26
  • If the repos are public anyway, why do you need to specify anything for them? You already have access, no?
    – AdamRalph
    Jul 29, 2015 at 7:12
  • Yes, that sounds plausible. I have to look into that again. Actually a long time since we put our that beta. I'm not actively working on it.
    – Teun D
    Jul 29, 2015 at 7:29
  • 3
    @AdamRalph I've fixed that. The site now requires only to read your public data. Thanks for alerting me, this scope was very inappropriate.
    – Teun D
    Aug 5, 2015 at 20:04
0

I am happy with Sourcetree.

  • It's free and available for Win and MacOS.
  • It shows branches in actually understandable graph.
  • It renders branches using consistent coloring (one branch ~ one color)

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .