http://gitgraphjs.com/ is an option:
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gitgraph.js/1.15.1/gitgraph.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/gitgraph.js/1.15.1/gitgraph.min.js" />
</head>
<body>
<canvas id="gitGraph"></canvas>
<script>
var gitgraph = new GitGraph({
template: "metro",
orientation: "horizontal",
mode: "compact"
});
var master = gitgraph.branch("master");
gitgraph.commit().commit().commit(); // 3 commits upon HEAD
var develop = gitgraph.branch("develop"); // New branch from HEAD
var myfeature = develop.branch("myfeature"); // New branch from develop
// Well, if you need to go deeper…
var hotfix = gitgraph.branch({
parentBranch: develop,
name: "hotfix",
column: 2 // which column index it should be displayed in
});
master.commit("This commit is mine"); // Add a commit on master branch
develop.commit({
dotColor: "white",
dotSize: 10,
dotStrokeWidth: 10,
sha1: "666",
message: "Pimp dat commit",
author: "Jacky <[email protected]>",
tag: "a-super-tag",
onClick: function(commit) {
console.log("Oh, you clicked my commit?!", commit);
}
});
</script>
</body>
Demonstrated by this fiddle - https://jsfiddle.net/h5mrLesu/