27

I like the ability of git to give me a visual tree showing how the commits flow on various branches, but with a lot of commits you may drown in detail.

I was wondering how I can just get the basic outline of the branch structure without all the individual commits, but with branch names put in the right locations anyway.

Much like gitk --all . but then zoomed a bit out.

Suggestions?


EDIT: 2013-03-16 - I have still not found a good solution to this. I've found however that the history view in Git Extensions for some reason gives better information than the history view in Eclipse.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347

4 Answers4

19

Using a hint from the question VonC linked in the comments, the following should suffice:

git log --oneline --decorate --all --graph --simplify-by-decoration
Community
  • 1
  • 1
Go Dan
  • 15,194
  • 6
  • 41
  • 65
13

You can use the --simplify-by-decoration option:

gitk --simplify-by-decoration --all

And if you are a CLI junkie, the same is possible in the console as well:

git log --oneline --decorate --graph --simplify-by-decoration --all
* a6b4b080e4 (origin/next) Merge branch 'jk/plug-list-object-filter-leaks' into next
| * 12f70ac9b5 (origin/seen) Merge branch 'jk/proto-v2-ref-prefix-fix' into seen
|/  
* 79f2338b37 (origin/master, origin/main, origin/HEAD) The eighteenth batch
* ac8035a2af (tag: v2.37.3, origin/maint) Git 2.37.3
* ad60dddad7 (tag: v2.37.2) Git 2.37.2
* bbea4dcf42 (tag: v2.37.1) Git 2.37.1
*   69ab3309e9 Sync with Git 2.36.2
|\  
| * fd59c5bdee (tag: v2.36.2) Git 2.36.2
| *   8f8eea8c3a Sync with 2.35.4
| |\  
| | * 359da658ae (tag: v2.35.4) Git 2.35.4
| | *   aef3d5948c Sync with 2.34.4
| | |\  
| | | * f2eed22852 (tag: v2.34.4) Git 2.34.4
| | | *   378eaded1a Sync with 2.33.4
.
.
.
knittl
  • 246,190
  • 53
  • 318
  • 364
3

I have a little Ruby script that uses graphviz to display a repository. It dies on really large repositories (but you can tweak it a little to not display too many intermediate commits). I use it during my git trainings and I've found it useful.

Update: I blogged about it here. There are pictures of the graphs as well as notes on how to use the scripts.

Noufal Ibrahim
  • 71,383
  • 13
  • 135
  • 169
2

For those who looking for GUI alternative. I use GitUp for Branch Visualisation. The UI looks sleek and clean. Although, GitUp can be used for editing Git repo. I only use its Visualisation tool. Its free, open source, and only 9.1 MB.

enter image description here

Another GUI tool is Git Client like Atlassian's Source Tree, Git Kraken or Git Tower. Those Client usually have built-in Git Visualisation tool.

aldok
  • 17,295
  • 5
  • 53
  • 64
  • 1
    Gitup is amazing. They have a command-line tool so you can just do `gitup` and it will visualize your current repo. – Matt Mc Jun 19 '18 at 05:14