Skip to content

Latest commit

 

History

History
602 lines (453 loc) · 15.6 KB

File metadata and controls

602 lines (453 loc) · 15.6 KB
layout default
menu_item api
title Remote
description Version 0.4.0
return_to
API Documentation Index
/api/
sections
create createAnonymous createWithFetchspec delete initCallbacks isValidName list lookup #addFetch #addPush #autotag #clearRefspecs #connect #connected #disconnect #download #dup #fetch #free #getCallbacks #getFetchRefspecs #getPushRefspecs #getRefspec #name #owner #prune #pruneRefs #push #pushurl #refspecCount #save #setAutotag #setCallbacks #setPushurl #setUpdateFetchhead #setUrl #stats #stop #updateFetchhead #updateTips #upload #url AUTOTAG_OPTION COMPLETION_TYPE
#create
#createAnonymous
#createWithFetchspec
#delete
#initCallbacks
#isValidName
#list
#lookup
#addFetch
#addPush
#autotag
#clearRefspecs
#connect
#connected
#disconnect
#download
#dup
#fetch
#free
#getCallbacks
#getFetchRefspecs
#getPushRefspecs
#getRefspec
#name
#owner
#prune
#pruneRefs
#push
#pushurl
#refspecCount
#save
#setAutotag
#setCallbacks
#setPushurl
#setUpdateFetchhead
#setUrl
#stats
#stop
#updateFetchhead
#updateTips
#upload
#url
#AUTOTAG_OPTION
#COMPLETION_TYPE

Remote.create Sync

var remote = Remote.create(repo, name, url);
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, fetch).then(function(remote) {
  // Use remote
});
Parameters Type
repo Repository the associated repository
url String the remote repository's URL
fetch String the fetch refspec to use for this remote.
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#addFetch Sync

var result = remote.addFetch(refspec);

| Parameters | Type | | --- | --- | --- | | refspec | String | the new fetch refspec |

Returns
Number 0 or an error value

Remote#addPush Sync

var result = remote.addPush(refspec);

| Parameters | Type | | --- | --- | --- | | refspec | String | the new push refspec |

Returns
Number 0 or an error value

Remote#autotag Sync

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

Remote#clearRefspecs Sync

remote.clearRefspecs();

Remote#connect Async

remote.connect(direction).then(function(result) {
  // Use result
});

| Parameters | Type | | --- | --- | --- | | direction | Number | GIT_DIRECTION_FETCH if you want to fetch or GIT_DIRECTION_PUSH if you want to push |

Returns
Number 0 or an error code

Remote#connected Sync

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

Remote#disconnect Async

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

Remote#download Async

remote.download(refspecs).then(function(result) {
  // Use result
});

| Parameters | Type | | --- | --- | --- | | refspecs | Strarray | the refspecs to use for this negotiation and download. Use NULL or an empty array to use the base refspecs |

Returns
Number 0 or an error code

Remote#dup Async

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

Remote#fetch Async

remote.fetch(refspecs, signature, reflog_message).then(function(result) {
  // Use result
});

| Parameters | Type | | --- | --- | --- | | refspecs | Strarray | the refspecs to use for this fetch. Pass NULL or an empty array to use the base refspecs. | | signature | Signature | The identity to use when updating reflogs | | reflog_message | String | The message to insert into the reflogs. If NULL, the default is "fetch" |

Returns
Number 0 or an error code

Remote#free Sync

remote.free();

Remote#getCallbacks Sync

var remoteCallbacks = remote.getCallbacks();
Returns
RemoteCallbacks the callbacks structure

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();
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, signature, message).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 | | signature | Signature | The identity to use for the reflog of the updated references | | message | String | The message to use for the update reflog messages |

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

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

Remote#save Sync

var result = remote.save();
Returns
Number 0, GIT_EINVALIDSPEC or an error code

Remote#setAutotag Sync

remote.setAutotag(value);

| Parameters | Type | | --- | --- | --- | | value | Number | a GIT_REMOTE_DOWNLOAD_TAGS value |

Remote#setCallbacks Sync

var result = remote.setCallbacks(callbacks);

| Parameters | Type | | --- | --- | --- | | callbacks | RemoteCallbacks | a pointer to the user's callback settings |

Returns
Number 0 or an error code

Remote#setPushurl Sync

var result = remote.setPushurl(url);

| Parameters | Type | | --- | --- | --- | | url | String | the url to set or NULL to clear the pushurl |

Returns
Number 0 or an error value

Remote#setUpdateFetchhead Sync

remote.setUpdateFetchhead(value);

| Parameters | Type | | --- | --- | --- | | value | Number | 0 to disable updating FETCH_HEAD |

Remote#setUrl Sync

var result = remote.setUrl(url);

| Parameters | Type | | --- | --- | --- | | url | String | the url to set |

Returns
Number 0 or an error value

Remote#stats Sync

var transferProgress = remote.stats();
Returns
TransferProgress

Remote#stop Sync

remote.stop();

Remote#updateFetchhead Sync

var result = remote.updateFetchhead();
Returns
Number the update FETCH_HEAD setting

Remote#updateTips Sync

var result = remote.updateTips(signature, reflog_message);

| Parameters | Type | | --- | --- | --- | | signature | Signature | The identity to use when updating reflogs | | reflog_message | String | The message to insert into the reflogs. If NULL, the default is "fetch ", where is the name of the remote (or its url, for in-memory remotes). |

Returns
Number 0 or an error code

Remote#upload Sync

var result = remote.upload(refspecs, opts);

| Parameters | Type | | --- | --- | --- | | refspecs | Strarray | the refspecs to use for this negotiation and upload. Use NULL or an empty array to use the base refspecs | | opts | PushOptions | |

Returns
Number 0 or an error code

Remote#url Sync

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

Remote.AUTOTAG_OPTION ENUM

| Flag | Value | | --- | --- | --- | | Remote.AUTOTAG_OPTION.DOWNLOAD_TAGS_AUTO | 0 | | Remote.AUTOTAG_OPTION.DOWNLOAD_TAGS_NONE | 1 | | Remote.AUTOTAG_OPTION.DOWNLOAD_TAGS_ALL | 2 |

Remote.COMPLETION_TYPE ENUM

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