You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
varresult=remote.connected();
Returns
Number
1 if it's connected, 0 otherwise.
Remote#defaultBranch Async
remote.defaultBranch().then(function(buf){// Use buf});
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
varrefspec=remote.getRefspec(n);
| Parameters | Type |
| --- | --- | --- |
| n | Number | the refspec to get |
| 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 | |