I've seen some books and articles have some really pretty looking graphs of git branches and commits. How can I make high-quality printable images of git history?
Join Stack Overflow to learn, share knowledge, and build your career.
|
|
I suggest You can use homebrew to install tig on macOS:
|
||||
|
|
This is my take on this matter:Screenshot:Usage:
Add Benefits:
Setup:
|
||||
|
|
|
I wrote a web tool for converting git logs into pretty SVG graphs: Bit-Booster - Offline Commit Graph Drawing Tool Upload output from The tool is pure-client-side, and so none of your Git data is shared with my server. You can also save the HTML + JS locally and run it using "file:///" URL's. Verified on Chrome 48 and Firefox 43 on Ubuntu 12.04. It generates HTML that can be posted directly into any page (including the blogspot blogging engine!). Take a look at some of the blog posts here: http://bit-booster.blogspot.ca/ Here's a screenshot of a sample HTML file generated by the tool: http://bit-booster.com/graph.html (the tool) |
|||||||||
|
|
I have this
With this in place, In Git 2.12+ you can even customize the line colors of the graph using the As for the logs' format, it's similar to |
|||||
|
|
Many of the answers here are great, but for those that just wants a simple one line to the point answer without having to setup aliases or anything extra, here it is:
Not everyone would be doing a git log all the time, but when you need it just remember: " A Dog " = git log --all --decorate --oneline --graph |
|||||||||||||||||||||
|
|
Based on a Graphviz script I found in an answer to a related question, I've hacked up a ruby script that creates a summary view of a git repository. It elides all linear history and just shows "interesting" commits, i.e. those with multiple parents, multiple children, or pointed to by a branch or tag. Here's a snippet of the graph it generates for jquery:
git-big-picture and BranchMaster are similar tools that try to show only the high-level structure of a graph, by only displaying how tags, branches, merges, etc. are related. This question has some more options. |
|||||||||
|
|
Update: This answer has gotten far more attention than it deserves. It was originally posted because I think the graphs look nice and they could be drawn-over in Illustrator for a publication– and there was no better solution. But there now exists much more applicable answers to this Q, such as fracz's, Jubobs', or Harry Lee's! Please go upvote those!! Update 2: I've posted an improved version of this answer to the Visualizing branch topology in git question, since it's far more appropriate there. That version includes 2¢: I have two aliases I normally throw in my
and |
|||||||||||||||||||||
|
|
For textual output you can try:
or:
or: here's a graphviz alias for drawing the DAG graph. |
|||||||||||||||||||||
|
|
Gitgraph.js allows to draw pretty git branches without a repository. Just write a Javascript code that configures your branches and commits and render it in browser.
or with
or with commit messages, authors, and tags:
Test it with JSFiddle. Generate it with Git Grapher by @bsara. |
|||||||||||||||||||||
|
|
There's a funky Git commit graph as one of the demos of the Raphael web graphics library. The demo is static, but it should be easy enough to take the code and swap out their static data for a live set of data -- I think it's just Git commit data in JSON format. The demo is here: http://dmitrybaranovskiy.github.io/raphael/github/impact.html |
|||||||||||||||||
|
|
Try ditaa. It can transform any ASCII diagram into an image. Although is was not designed with Git branches in mind, I was impressed by the results. Source (txt file):
Command:
Result: It also supports background colors, dashed lines, different shapes and more. See the examples. |
|||
|
|
|
I've added three custom commands:
|
|
|
|||
|
|
Turned out to be an old version of git. Yum has a pretty outdated version of Git in its repo. Compiled from source (1.9) and it works great. It's beautiful too! Thanks @gospes!
– Swivel
Apr 3 '14 at 19:18
|
||
|
|
|||
|
|
@SlippD.Thompson: I'm using linux :). The -r is for extended regular expressions. Apparently the OSX version of sed doesn't have it. Perhaps you could update sed. Otherwise, you can just rewrite the sed command without extended regex.
– gospes
Apr 28 '14 at 7:51
|
||
|
This is my terminal variation, similar to many answers here. I like to adjust the flags passed to I set this to an alias for quick access since the command is a bit cumbersome. |
||||
|
|
|
Although sometimes I use gitg, always come back to command line:
As you can see is almost a keystroke saving aliases, based on:
See in recent version of git (1.8.5 and above) you can benefit from %C(auto) in decorate placeholder %d From here all you need is a good understand of gitrevisions to filter whatever you need (something like master..develop, where --simplify-merges could help with long term branches) The power behind command line is the quickly config based on your needs (understand a repo isn't a unique key log configuration, so adding --numstat, or --raw, or --name-status is sometimes needed. Here git log and aliases are fast, powerful and (with time) the prettiest graph you can achieved. Even more, with output showed by default through a pager (say less) you can always search quickly inside results. Not convinced? You can always parse the result with projects like gitgraph |
|||||
|
|
Depends on what they looked like. I use gitx which makes pictures like this one:
You can compare
|
|||||||||||||||||
|
|
Gitg is a clone of Gitk and GitX for GNOME (it also works on KDE etc.) which shows a pretty colored graph. It is actively developed (as of 2012). It lets you sort the commits (graph nodes) either chronologically or topologically, and hide commits that don't lead to a selected branch. It works fine with large repositories and complex dependency graphs. Sample screenshots, showing the linux-git and linux-2.6 repositories: |
||||
|
|
|
These are some of the things I love about this script:
I have an alias using
This is how the output looks like on a terminal: |
|||||||||||||||||
|
|
For OSX users, I've taken the @gospes example and slightly modified it for gsed (
The key for OSX is to first install gnu sed (which has the -r option). Most easily done with homebrew, which will not overwrite the system-installed sed, but will instead install gnu sed as "gsed". Hope this helps @SlippD.Thompson who commented above about OSX not working. |
||||
|
|
|
Built on top of TikZ & PGF, Automatic generation of an existing repository's commit graph is not the purpose of I often use it to produce graphs for my answers to Git questions, as an alternative to ASCII commit graphs:
Here is an example of such a graph demonstrating the effects of a simple rebase:
|
|||||||||||||||||||||
|
|
I just wrote one tool that can generate pretty git commits graph using HTML/Canvas. And provide a jQuery plugin which make it easy to use. [github] https://github.com/tclh123/commits-graph Preview:
|
|||||||||
|
|
gitg: a gtk-based repository viewer, that's new but interesting and useful |
|||||
|
|
SourceTree is a really good one. It does print out a good looking and medium size history and branch graph: (the following is done on an experimental Git project just to see some branches). Supports Windows 7+ and Mac OS X 10.6+.
|
|||||||||||||||||
|
|
GitGraph Generates a PNG or SVG representation of your Git repository's commit history. |
|||||||||
|
|
Very slightly tweaking Slipp's awesome answer, you can use his aliases to log just one branch:
By leaving off the
or even
|
||||
|
|
|
For more detailed textual output, please try:
You can write alias in $HOME/.gitconfig
|
||||
|
|
|
Did you try |
|||||
|
|
I don't know about a direct tool, but maybe you can hack a script to export the data into dot format and render it with graphviz. |
|||||||||
|
protected by Jonathon Reinhart Sep 7 '15 at 20:23
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?























