Skip to content

Instantly share code, notes, and snippets.

@nullfieldio
Last active December 9, 2019 18:48
Show Gist options
  • Save nullfieldio/2f227c987c0ff0affd0e2931b61421e1 to your computer and use it in GitHub Desktop.
Save nullfieldio/2f227c987c0ff0affd0e2931b61421e1 to your computer and use it in GitHub Desktop.
@gitgraph/js playground
<div id="graph-container"></div>
const graphContainer = document.getElementById("graph-container");
const options = {
author: "rabbit <[email protected]>",
};
// Instantiate the graph.
const gitgraph = GitgraphJS.createGitgraph(graphContainer,options);
// Simulate git commands with Gitgraph API.
const master = gitgraph.branch("master");
master.commit("QCR Release 2019.12");
master.tag("QCR Release 2019.12");
const release = gitgraph.branch("qcr/2019.13");
release.commit("Initial Creation of release branch qcr-2019.13");
const aFeature = gitgraph.branch("BUG-1234");
aFeature
.commit("Fix it")
.commit("Fix it for realz")
.commit("Make it faster");
release.merge(aFeature);
release.commit("QCR Release 2019.13");
master.merge(release).tag("qcr-2019.13");
const release2 = gitgraph.branch("qcr/2019.14");
//release2.commit("Initial Creation of release branch qcr-2019.14");
<script src="https://cdn.jsdelivr.net/npm/@gitgraph/js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment