Pretty git branch graphs

前端 未结 30 2041
情话喂你
情话喂你 2020-11-22 01:34

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?

30条回答
  •  梦谈多话
    2020-11-22 02:03

    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.

    var gitGraph = new GitGraph({
       template: "blackarrow",
       mode: "compact",
       orientation: "horizontal",
       reverseArrow: true
    });
    
    var master = gitGraph.branch("master").commit().commit();
    var develop = gitGraph.branch("develop").commit();
    master.commit();
    develop.commit().commit();
    develop.merge(master);
    

    sample graph generated with Gitgraph.js

    or with metro template:

    GitGraph.js metro theme

    or with commit messages, authors, and tags:

    GitGraph with commit messages

    Test it with JSFiddle.

    Generate it with Git Grapher by @bsara.

提交回复
热议问题