Merge.base Async

Merge.base(repo, one, two).then(function(oid) {
  // Use oid
});
Parameters Type  
repo Repository the repository where the commits exist
one Oid one of the commits
two Oid the other commit
Returns  
Oid the OID of a merge base between ‘one’ and ‘two’

Merge.bases Async

Merge.bases(repo, one, two).then(function(oidarray) {
  // Use oidarray
});
Parameters Type  
repo Repository the repository where the commits exist
one Oid one of the commits
two Oid the other commit
Returns  
Oidarray array in which to store the resulting ids

Merge.commits Sync

Merge.commits(repo, ourCommit, theirCommit, [options]);

Merge 2 commits together and create an new index that can be used to create a merge commit.

Parameters Type  
repo Repository Repository that contains the given commits
ourCommit Commit The commit that reflects the destination tree
theirCommit Commit The commit to merge into ourCommit
[options] MergeOptions The merge tree options (null for default)

Merge.fileInitInput Sync

var result = Merge.fileInitInput(opts, version);
Parameters Type  
opts MergeFileInput the git_merge_file_input instance to initialize.
version Number the version of the struct; you should pass GIT_MERGE_FILE_INPUT_VERSION here.
Returns  
Number Zero on success; -1 on failure.

Merge.initOptions Sync

var result = Merge.initOptions(opts, version);
Parameters Type  
opts MergeOptions the git_merge_options instance to initialize.
version Number the version of the struct; you should pass GIT_MERGE_OPTIONS_VERSION here.
Returns  
Number Zero on success; -1 on failure.

Merge.merge Sync

Merge.merge(repo, theirHead, [mergeOpts], [checkoutOpts]);

Merge a commit into HEAD and writes the results to the working directory.

Parameters Type  
repo Repository Repository that contains the given commits
theirHead AnnotatedCommit The annotated commit to merge into HEAD
[mergeOpts] MergeOptions The merge tree options (null for default)
[checkoutOpts] CheckoutOptions The checkout options (null for default)

Merge.trees Async

Merge.trees(repo, ancestor_tree, our_tree, their_tree, opts).then(function(index) {
  // Use index
});
Parameters Type  
repo Repository repository that contains the given trees
ancestor_tree Tree the common ancestor between the trees (or null if none)
our_tree Tree the tree that reflects the destination tree
their_tree Tree the tree to merge in to our_tree
opts MergeOptions the merge tree options (or null for defaults)
Returns  
Index  

Merge.ANALYSIS ENUM

Flag Value
Merge.ANALYSIS.NONE 0
Merge.ANALYSIS.NORMAL 1
Merge.ANALYSIS.UP_TO_DATE 2
Merge.ANALYSIS.FASTFORWARD 4
Merge.ANALYSIS.UNBORN 8

Merge.FILE_FAVOR ENUM

Flag Value
Merge.FILE_FAVOR.NORMAL 0
Merge.FILE_FAVOR.OURS 1
Merge.FILE_FAVOR.THEIRS 2
Merge.FILE_FAVOR.UNION 3

Merge.FILE_FLAG ENUM

Flag Value
Merge.FILE_FLAG.FILE_DEFAULT 0
Merge.FILE_FLAG.FILE_STYLE_MERGE 1
Merge.FILE_FLAG.FILE_STYLE_DIFF3 2
Merge.FILE_FLAG.FILE_SIMPLIFY_ALNUM 4
Merge.FILE_FLAG.FILE_IGNORE_WHITESPACE 8
Merge.FILE_FLAG.FILE_IGNORE_WHITESPACE_CHANGE 16
Merge.FILE_FLAG.FILE_IGNORE_WHITESPACE_EOL 32
Merge.FILE_FLAG.FILE_DIFF_PATIENCE 64
Merge.FILE_FLAG.FILE_DIFF_MINIMAL 128

Merge.FLAG ENUM

Flag Value
Merge.FLAG.FIND_RENAMES 1
Merge.FLAG.FAIL_ON_CONFLICT 2
Merge.FLAG.SKIP_REUC 4
Merge.FLAG.NO_RECURSIVE 8

Merge.PREFERENCE ENUM

Flag Value
Merge.PREFERENCE.NONE 0
Merge.PREFERENCE.NO_FASTFORWARD 1
Merge.PREFERENCE.FASTFORWARD_ONLY 2