Skip to content

Latest commit

 

History

History
605 lines (461 loc) · 16.3 KB

File metadata and controls

605 lines (461 loc) · 16.3 KB
layout default
menu_item api
title Remote
description Version 0.19.0
return_to
API Documentation Index
/api/
sections
addFetch addPush create createAnonymous createWithFetchspec delete initCallbacks isValidName list lookup setAutotag setPushurl setUrl #autotag #connect #connected #defaultBranch #disconnect #download #dup #fetch #free #getFetchRefspecs #getPushRefspecs #getRefspec #name #owner #prune #pruneRefs #push #pushurl #referenceList #refspecCount #stats #stop #updateTips #upload #url AUTOTAG_OPTION COMPLETION_TYPE
#addFetch
#addPush
#create
#createAnonymous
#createWithFetchspec
#delete
#initCallbacks
#isValidName
#list
#lookup
#setAutotag
#setPushurl
#setUrl
#autotag
#connect
#connected
#defaultBranch
#disconnect
#download
#dup
#fetch
#free
#getFetchRefspecs
#getPushRefspecs
#getRefspec
#name
#owner
#prune
#pruneRefs
#push
#pushurl
#referenceList
#refspecCount
#stats
#stop
#updateTips
#upload
#url
#AUTOTAG_OPTION
#COMPLETION_TYPE

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.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.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 remove to delete
Returns
Number 0 on success, or an error code.

Remote.initCallbacks Sync

var result = Remote.initCallbacks(opts, version);
Parameters Type
opts RemoteCallbacks the git_remote_callbacks struct to initialize
version Number Version of struct; pass GIT_REMOTE_CALLBACKS_VERSION
Returns
Number Zero on success; -1 on failure.

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#free Sync

remote.free();

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 transferProgress = remote.stats();
Returns
TransferProgress

Remote#stop Sync

remote.stop();

Remote#updateTips Sync

var result = remote.updateTips(callbacks, update_fetchhead, download_tags, reflog_message);

| Parameters | Type | | --- | --- | --- | | callbacks | RemoteCallbacks | pointer to the callback structure to use | | update_fetchhead | Number | whether to write to FETCH_HEAD. Pass 1 to behave like git. | | download_tags | Number | what the behaviour for downloading tags is for this fetch. This is ignored for push. This must be the same value passed to git_remote_download(). | | reflog_message | 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. |

Returns
Number 0 or an error code

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_TYPE ENUM

| Flag | Value | | --- | --- | --- | | Remote.COMPLETION_TYPE.COMPLETION_DOWNLOAD | 0 | | Remote.COMPLETION_TYPE.COMPLETION_INDEXING | 1 | | Remote.COMPLETION_TYPE.COMPLETION_ERROR | 2 |