Skip to content
This repository has been archived by the owner on Jul 13, 2024. It is now read-only.

Commit

Permalink
Add use cases to main example
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoespeon committed Mar 29, 2017
1 parent 32780da commit d3723cc
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var myTemplate = new GitGraph.Template(myTemplateConfig);
***********************/

var config = {
template: "metro", // could be: "blackarrow" or "metro" or `myTemplate` (custom Template object)
template: "blackarrow", // could be: "blackarrow" or "metro" or `myTemplate` (custom Template object)
reverseArrow: false, // to make arrows point to ancestors, if displayed
orientation: "vertical",
// mode: "compact" // special compact mode: hide messages & compact graph
Expand All @@ -53,7 +53,7 @@ gitGraph.commit("Initial commit");
gitGraph.commit("My second commit").commit("Add awesome feature");

// Create a new "dev" branch from "master" with some custom configuration
var dev = gitGraph.branch({
var dev = master.branch({
name: "dev",
color: "#F00",
commitDefaultOptions: {
Expand All @@ -78,6 +78,10 @@ var commitConfig = {
};
gitGraph.commit(commitConfig);

// Create another from "master"
var feature3 = master.branch("feature3")
feature3.commit().commit();

/***********************
* CHECKOUT *
***********************/
Expand Down Expand Up @@ -167,6 +171,13 @@ test.merge(master, {
tag: "v1.0.0"
});

// Create different branches from an empty one and do some commits
var features = master.branch("features")
var feature1 = features.branch("feature1")
var feature2 = features.branch("feature2")
feature1.commit();
feature2.commit().commit();

/***********************
* EVENTS *
***********************/
Expand Down

0 comments on commit d3723cc

Please sign in to comment.