Skip to content

Instantly share code, notes, and snippets.

@valentinsavenko
Created April 1, 2020 12:02
Show Gist options
  • Save valentinsavenko/cec0da054cd1d289efd54ef71877ac8c to your computer and use it in GitHub Desktop.
Save valentinsavenko/cec0da054cd1d289efd54ef71877ac8c to your computer and use it in GitHub Desktop.
@gitgraph/js Sigi-Flow
<div id="graph-container"> </div>
const graphContainer = document.getElementById("graph-container");
// Instantiate the graph.
const gitgraph = GitgraphJS.createGitgraph(graphContainer);
// Simulate git commands with Gitgraph API.
const develop = gitgraph.branch("develop");
develop.commit({ subject: "first ever commit", author:'' });
const saas = develop.branch("saas");
const releaseCandidateOld = develop.branch("release-candidate-13.14.0");
releaseCandidateOld.commit({ subject: "Fix random bug found by qa", author:'' });
saas.merge(releaseCandidateOld);
develop.commit({ subject: "nice feature for 13.15.0-next", author:'' });
develop.commit({ subject: "nice feature2 for 13.15.0-next", author:'' });
develop.commit({ subject: "nice feature2 for 13.15.0-next", author:'' });
develop.commit({ subject: "nice stable version of develop", author:'' });
const releaseCandidate = develop.branch({ name:"release-candidate-13.15.0", author:''});
releaseCandidate
.commit({ subject: "bump version to release -> 13.15.0", author:'' })
.commit({ subject: "Fix random bug found by qa", author:'' })
.commit({ subject: "move button by 1 pixel for PO", author:'' });
const hotfix = saas.branch({ name:"Hotfix-13.14.1", author:'' });
hotfix.commit({ subject: "Hotfix to fix important bug 13.15.1", author:'' });
saas.merge(hotfix);
releaseCandidate.merge(hotfix);
saas.merge(releaseCandidate).tag('13.15.0');
develop.merge(saas);
releaseCandidate.commit("bump version to 13.16.0-next");
develop.merge(releaseCandidate);
<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