Remote.addFetch Sync

var result = Remote.addFetch(repo, remote, refspec);
Parameters Type  
repo Repository the repository in which to change the configuration
remote String the name of the remote to change
refspec String the new fetch refspec
Returns  
Number 0, GIT_EINVALIDSPEC if refspec is invalid or an error value

Remote.addPush Sync

var result = Remote.addPush(repo, remote, refspec);
Parameters Type  
repo Repository the repository in which to change the configuration
remote String the name of the remote to change
refspec String the new push refspec
Returns  
Number 0, GIT_EINVALIDSPEC if refspec is invalid or an error value

Remote.create Async

Remote.create(repo, name, url).then(function(remote) {
  // Use remote
});
Parameters Type  
repo Repository the repository in which to create the remote
name String the remote’s name
url String the remote’s url
Returns  
Remote the resulting remote

Remote.createAnonymous Async

Remote.createAnonymous(repo, url).then(function(remote) {
  // Use remote
});
Parameters Type  
repo Repository the associated repository
url String the remote repository’s URL
Returns  
Remote  

Remote.createDetached Async

Remote.createDetached(url).then(function(remote) {
  // Use remote
});
Parameters Type  
url String the remote repository’s URL
Returns  
Remote  

Remote.createWithFetchspec Async

Remote.createWithFetchspec(repo, name, url, fetch).then(function(remote) {
  // Use remote
});
Parameters Type  
repo Repository the repository in which to create the remote
name String the remote’s name
url String the remote’s url
fetch String the remote fetch value
Returns  
Remote the resulting remote

Remote.createWithOpts Async

Remote.createWithOpts(url, opts).then(function(remote) {
  // Use remote
});
Parameters Type  
url String the remote’s url
opts RemoteCreateOptions the remote creation options
Returns  
Remote the resulting remote

Remote.delete Async

Remote.delete(repo, name).then(function(result) {
  // Use result
});
Parameters Type  
repo Repository the repository in which to act
name String the name of the remote to delete
Returns  
Number 0 on success, or an error code.

Remote.isValidName Sync

var result = Remote.isValidName(remote_name);
Parameters Type  
remote_name String name to be checked.
Returns  
Number 1 if the reference name is acceptable; 0 if it isn’t

Remote.list Async

Remote.list(repo).then(function(array) {
  // Use array
});
Parameters Type  
repo Repository the repository to query
Returns  
Array a string array which receives the names of the remotes

Remote.lookup Async

Remote.lookup(repo, name, callback).then(function(remote) {
  // Use remote
});

Retrieves the remote by name

Parameters Type  
repo Repository The repo that the remote lives in
name String, Remote The remote to lookup
callback Function  
Returns  
Remote  

Remote.setAutotag Sync

var result = Remote.setAutotag(repo, remote, value);
Parameters Type  
repo Repository the repository in which to make the change
remote String the name of the remote
value Number the new value to take.
Returns  
Number  

Remote.setPushurl Sync

var result = Remote.setPushurl(repo, remote, url);
Parameters Type  
repo Repository the repository in which to perform the change
remote String the remote’s name
url String the url to set
Returns  
Number  

Remote.setUrl Sync

var result = Remote.setUrl(repo, remote, url);
Parameters Type  
repo Repository the repository in which to perform the change
remote String the remote’s name
url String the url to set
Returns  
Number 0 or an error value

Remote#autotag Sync

var result = remote.autotag();
Returns  
Number the auto-follow setting

Remote#connect Async

remote.connect(direction, callbacks, proxyOpts, customHeaders, callback).then(function(number) {
  // Use number
});

Connects to a remote

Parameters Type  
direction Enums.DIRECTION The direction for the connection
callbacks RemoteCallbacks The callback functions for the connection
proxyOpts ProxyOptions Proxy settings
customHeaders Array<string> extra HTTP headers to use
callback Function  
Returns  
Number error code

Remote#connected Sync

var result = remote.connected();
Returns  
Number 1 if it’s connected, 0 otherwise.

Remote#defaultBranch Async

remote.defaultBranch().then(function(buf) {
  // Use buf
});
Returns  
Buf the buffern in which to store the reference name

Remote#disconnect Async

remote.disconnect().then(function() {
  // method complete});

Remote#download Async

remote.download(refSpecs, opts, callback).then(function(number) {
  // Use number
});

Connects to a remote

Parameters Type  
refSpecs Array The ref specs that should be pushed
opts FetchOptions The fetch options for download, contains callbacks
callback Function  
Returns  
Number error code

Remote#dup Async

remote.dup().then(function(remote) {
  // Use remote
});
Returns  
Remote the copy

Remote#fetch Async

remote.fetch(refSpecs, opts, message, callback).then(function(number) {
  // Use number
});

Connects to a remote

Parameters Type  
refSpecs Array The ref specs that should be pushed
opts FetchOptions The fetch options for download, contains callbacks
message String The message to use for the update reflog messages
callback Function  
Returns  
Number error code

Remote#getFetchRefspecs Async

remote.getFetchRefspecs().then(function(array) {
  // Use array
});
Returns  
Array  

Remote#getPushRefspecs Async

remote.getPushRefspecs().then(function(array) {
  // Use array
});
Returns  
Array  

Remote#getRefspec Sync

var refspec = remote.getRefspec(n);
Parameters Type  
n Number the refspec to get
Returns  
Refspec the nth refspec

Remote#name Sync

var string = remote.name();
Returns  
String the name or NULL for in-memory remotes

Remote#owner Sync

var repository = remote.owner();
Returns  
Repository the repository

Remote#prune Sync

var result = remote.prune(callbacks);
Parameters Type  
callbacks RemoteCallbacks callbacks to use for this prune
Returns  
Number 0 or an error code

Remote#pruneRefs Sync

var result = remote.pruneRefs();
Returns  
Number the ref-prune setting

Remote#push Async

remote.push(refSpecs, options, callback).then(function(number) {
  // Use number
});

Pushes to a remote

Parameters Type  
refSpecs Array The ref specs that should be pushed
options PushOptions Options for the checkout
callback Function  
Returns  
Number error code

Remote#pushurl Sync

var string = remote.pushurl();
Returns  
String the url or NULL if no special url for pushing is set

Remote#referenceList Async

remote.referenceList().then(function(promiseArrayRemoteHead) {
  // Use promiseArrayRemoteHead
});

Lists advertised references from a remote. You must connect to the remote before using referenceList.

Returns  
Array<RemoteHead>> a list of the remote heads the remote had available at the last established
connection.  

Remote#refspecCount Sync

var result = remote.refspecCount();
Returns  
Number the amount of refspecs configured in this remote

Remote#stats Sync

var indexerProgress = remote.stats();
Returns  
IndexerProgress  

Remote#stop Sync

remote.stop();

Remote#updateTips Sync

remote.updateTips(callbacks, updateFetchhead, downloadTags, reflogMessage);

Update the tips to the new state

Parameters Type  
callbacks RemoteCallbacks The callback functions for the connection
updateFetchhead boolean whether to write to FETCH_HEAD. Pass true to behave like git.
downloadTags boolean what the behaviour for downloading tags is for this fetch. This is ignored for push. This must be the same value passed to Remote.prototype.download
reflogMessage string The message to insert into the reflogs. If null and fetching, the default is “fetch “, where is the name of the remote (or its url, for in-memory remotes). This parameter is ignored when pushing.

Remote#upload Async

remote.upload(refSpecs, options, callback).then(function(number) {
  // Use number
});

Pushes to a remote

Parameters Type  
refSpecs Array The ref specs that should be pushed
options PushOptions Options for the checkout
callback Function  
Returns  
Number error code

Remote#url Sync

var string = remote.url();
Returns  
String the url

Remote.AUTOTAG_OPTION ENUM

Flag Value
Remote.AUTOTAG_OPTION.DOWNLOAD_TAGS_UNSPECIFIED 0
Remote.AUTOTAG_OPTION.DOWNLOAD_TAGS_AUTO 1
Remote.AUTOTAG_OPTION.DOWNLOAD_TAGS_NONE 2
Remote.AUTOTAG_OPTION.DOWNLOAD_TAGS_ALL 3

Remote.COMPLETION ENUM

Flag Value
Remote.COMPLETION.DOWNLOAD 0
Remote.COMPLETION.INDEXING 1
Remote.COMPLETION.ERROR 2

Remote.CREATE_FLAGS ENUM

Flag Value
Remote.CREATE_FLAGS.CREATE_SKIP_INSTEADOF 1
Remote.CREATE_FLAGS.CREATE_SKIP_DEFAULT_FETCHSPEC 2