nodegit-flow is a drop in replacement for nodegit. All methods in nodegit are included in nodegit-flow.
You must provide the nodegit module to nodegit-flow.
var nodegit = require('nodegit-flow')(require('nodegit')); // wrap nodegit in git flow methods
You can initialize an instance of nodegit-flow or use its static methods
By default finishFeature will merge the feature branch into the develop branch and delete the feature branch. If successful, finishFeature will resolve with the merge commit. If a merge conflict occurs finishFeature will reject with the index of the conflict.
options Object
isRebase Boolean default=false
keepBranch Boolean default=false
Example:
NodeGit.Flow.finishFeature( repository, 'my-feature') .then((mergeCommit) => { console.log(mergeCommit.id()); // => the sha of the newly created commit });
finishHotfix(repository, name, [options])
By default finishHotfix will merge the hotfix branch into the develop branch and the master branch, create a tag at the merge commit on master, and delete the hotfix branch. If successful, finishHotfix will resolve with the merge commit on develop. If a merge conflict occurs finishHotfix will reject with the index of the conflict.
options Object
keepBranch Boolean default=false
message String tag annotation default=''
Example:
NodeGit.Flow.finishHotfix( repository, 'my-hotfix') .then((mergeCommit) => { console.log(mergeCommit.id()); // => the sha of the newly created commit });
finishRelease(repository, name, [options])
By default finishRelease will merge the release branch into the develop branch and the master branch, create a tag the points to the merge commit on master, and delete the release branch. If successful, finishRelease will resolve with the merge commit. If a merge conflict occurs finishRelease will reject with the index of the conflict.
options Object
isRebase Boolean default=false
keepBranch Boolean default=false
message String tag annotation default=''
Example:
NodeGit.Flow.finishRelease( repository, 'my-release') .then((mergeCommit) => { console.log(mergeCommit.id()); // => the sha of the newly created commit });
getConfig(repository)
Retrieves an object that contains the git config values that are relevant to git flow
getConfigDefault()
Returns the following object which is the standard git flow config object
Returns the config keys that are required to use nodegit-flow
getDevelopBranch(repository)
Returns the value stored within a repos git config with the key of gitflow.branch.develop
getHotfixPrefix(repository)
Returns the value stored within a repos git config with the key of gitflow.prefix.hotfix
getMasterBranch(repository)
Returns the value stored within a repos git config with the key of gitflow.branch.master
getFeaturePrefix(repository)
Returns the value stored within a repos git config with the key of gitflow.prefix.feature
getReleasePrefix(repository)
Returns the value stored within a repos git config with the key of gitflow.prefix.release
getSupportPrefix(repository)
Returns the value stored within a repos git config with the key of gitflow.prefix.support
getVersionTagPrefix(repository)
Returns the value stored within a repos git config with the key of gitflow.prefix.versiontag
init(repository, config)
Sets the git flow config values for the given repo and returns a new instance of nodegit-flow. This new instance contains all of the static methods within the NodeGit.Flow object but does not require a repository to be passed in when using its methods.
isInitialized(repository)
Resolves to true or false depending on whether the repository has git flow initialized
Example:
NodeGit.Flow.isInitialized(repository) .then((isInitialized) => { console.log(isInitialized); // => true or false depending the git config of the repo });
open(repository)
Resolves to a new instance of nodegit-flow if the repository has git flow initialized, otherwise reject with the reason