1
0
mirror of https://github.com/danog/gift.git synced 2024-11-30 04:19:37 +01:00

Merge pull request #47 from bpartridge83/master

Git Remotes: Adding and Deleting URLs
This commit is contained in:
Luke Plaster 2014-11-11 17:29:26 +01:00
commit 4bb16ecec2
2 changed files with 28 additions and 0 deletions

View File

@ -115,6 +115,12 @@ Get the string names of each of the remotes.
### `Repo#remote_add(name, url, callback)`
Equivalent to `git remote add <name> <url>`.
### `Repo#remote_add_url(name, url, callback)`
Equivalent to `git remote set-url --add <name> <url>`.
### `Repo#remote_delete_url(name, url, callback)`
Equivalent to `git remote set-url --delete <name> <url>`.
### `Repo#remote_remove(name, callback)`
Remove a remote.

View File

@ -187,6 +187,28 @@ module.exports = class Repo
, (err, stdout, stderr) ->
callback err
# Public: Add a remote URL.
#
# name - String name of the remote.
# url - String url of the remote.
# callback - Receives `(err)`
#
remote_add_url: (name, url, callback) ->
@git "remote set-url", {}, ["--add", name, url]
, (err, stdout, stderr) ->
callback err
# Public: Delete a remote URL.
#
# name - String name of the remote.
# url - String url of the remote.
# callback - Receives `(err)`
#
remote_delete_url: (name, url, callback) ->
@git "remote set-url", {}, ["--delete", name, url]
, (err, stdout, stderr) ->
callback err
# Public: Remove a remote.
#
# name - String name of the remote.