diff --git a/README.md b/README.md index 466b949..1982e9b 100644 --- a/README.md +++ b/README.md @@ -115,19 +115,22 @@ Get the string names of each of the remotes. ### `Repo#remote_add(name, url, callback)` Equivalent to `git remote add `. +### `Repo#remote_remove(name, callback)` +Remove a remote. + ### `Repo#remote_add_url(name, url, callback)` Equivalent to `git remote set-url --add `. +### `Repo#remote_set_url(name, url, callback)` +Equivalent to `git remote set-url `. + ### `Repo#remote_delete_url(name, url, callback)` Equivalent to `git remote set-url --delete `. -### `Repo#remote_remove(name, callback)` -Remove a remote. - ### `Repo#remote_fetch(name, callback)` `git fetch ` -### `Repo#remote_push(name, [branch, ]callback)` +### `Repo#remote_push(name, [branch,] callback)` `git push ` with branch parameter specified: diff --git a/src/repo.coffee b/src/repo.coffee index 404e6d9..450af63 100644 --- a/src/repo.coffee +++ b/src/repo.coffee @@ -187,6 +187,16 @@ module.exports = class Repo , (err, stdout, stderr) -> callback err + # Public: Remove a remote. + # + # name - String name of the remote. + # callback - Receives `(err)` + # + remote_remove: (name, callback) -> + @git "remote", {}, ["rm", name] + , (err, stdout, stderr) -> + callback err + # Public: Add a remote URL. # # name - String name of the remote. @@ -198,6 +208,17 @@ module.exports = class Repo , (err, stdout, stderr) -> callback err + # Public: Set a remote URL. + # + # name - String name of the remote. + # url - String url to set in the remote. + # callback - Receives `(err)`. + # + remote_set_url: (name, url, callback) -> + @git "remote set-url", {}, [name, url] + , (err, stdout, stderr) -> + callback err + # Public: Delete a remote URL. # # name - String name of the remote. @@ -209,16 +230,6 @@ module.exports = class Repo , (err, stdout, stderr) -> callback err - # Public: Remove a remote. - # - # name - String name of the remote. - # callback - Receives `(err)` - # - remote_remove: (name, callback) -> - @git "remote", {}, ["rm", name] - , (err, stdout, stderr) -> - callback err - # Public: `git fetch `. # # name - String name of the remote