Class: Branch

Branch(options)

new Branch(options)

Branch

This:
Parameters:
Name Type Description
options object

Options of branch

Properties
Name Type Attributes Default Description
parent GitGraph

GitGraph constructor

parentBranch Branch <optional>
options.parentCommit.branch

Parent branch

parentCommit Commit <optional>
_getLast(options.parentBranch.commits)

Parent commit

name string <optional>
"no-name"

Branch name

lineDash Array.<number> <optional>
this.template.branch.lineDash

Branch line dash segments

commitDefaultOptions object <optional>
{}

Default options for commits

Source:

Methods

branch(options) → {Branch}

Create new branch

This:
Parameters:
Name Type Description
options string | object

Branch name | Options of Branch

Source:
See:
Returns:

New Branch

Type
Branch

calculColumn()

Calcul column

This:
Source:

checkout()

Checkout onto this branch

This:
Source:

commit(optionsopt)

Add a commit

This:
Parameters:
Name Type Attributes Description
options string | BranchCommitOptions <optional>

Message | Options of commit

Properties
Name Type Attributes Description
detailId string <optional>

Id of detail DOM Element

Source:
See:

delete()

Delete this branch

This:
Source:

merge(targetopt, commitOptionsopt) → {Branch}

Merge branch

This:
Parameters:
Name Type Attributes Default Description
target Branch <optional>
this.parent.HEAD
commitOptions string | object <optional>

Message | Options of commit

Properties
Name Type Attributes Default Description
fastForward boolean <optional>
false

If true, merge should use fast-forward if possible

Source:
See:
Returns:

this

Type
Branch

pushPath()

Push a new point to path. This method will combine duplicate points and reject reversed points.

This:
Source:

render()

Render the branch

This:
Source:

tag(optionsopt)

Tag the last commit of the branch.

This:
Parameters:
Name Type Attributes Description
options string | object <optional>

Message | Options of the tag

Properties
Name Type Attributes Description
tag string <optional>

Message of the tag

tagColor string <optional>

Color of the tag

tagFont string <optional>

Font of the tag

displayTagBox boolean <optional>

If true, display a box around the tag

Source:
See: