summaryrefslogtreecommitdiff
path: root/Documentation/git-remote.txt
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-11-25 12:48:26 +0100
committerJunio C Hamano <gitster@pobox.com>2014-11-26 10:05:04 -0800
commite6196ae10f6a05d74bae4542b6b675831f3b9c20 (patch)
tree15a3e52f955842ddf3cb42f48b74f7a0e67f8096 /Documentation/git-remote.txt
parent652e759330da379a8e09e03bbf99e03c10c228cc (diff)
downloadgit-pw/remote-set-url-fetch.tar.gz
remote: add --fetch and --both options to set-urlpw/remote-set-url-fetch
git remote set-url knew about the '--push' option to update just the pushurl, but it does not have a similar option for "update fetch URL and leave whatever was in place for the push URL". This patch adds support for a '--fetch' option which implements that use case in a backwards compatible way: if no --both, --push or --fetch options are given, then the push URL is modified too if it was not set before. This is the case since the push URL is implicitly based on the fetch URL. A '--both' option is added to make the command independent of previous pushurl settings. For the --add and --delete set operations, it will always set the push and/ or the fetch URLs. For the primary mode of operation (without --add or --delete), it will drop pushurl as the implicit push URL is the (fetch) URL. The documentation has also been updated and a missing '--push' option is added to the 'git remote -h' command. Tests are also added to verify the documented behavior. Signed-off-by: Peter Wu <peter@lekensteyn.nl> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-remote.txt')
-rw-r--r--Documentation/git-remote.txt17
1 files changed, 13 insertions, 4 deletions
diff --git a/Documentation/git-remote.txt b/Documentation/git-remote.txt
index cb103c8b6f..bdd0305c29 100644
--- a/Documentation/git-remote.txt
+++ b/Documentation/git-remote.txt
@@ -15,9 +15,9 @@ SYNOPSIS
'git remote remove' <name>
'git remote set-head' <name> (-a | --auto | -d | --delete | <branch>)
'git remote set-branches' [--add] <name> <branch>...
-'git remote set-url' [--push] <name> <newurl> [<oldurl>]
-'git remote set-url --add' [--push] <name> <newurl>
-'git remote set-url --delete' [--push] <name> <url>
+'git remote set-url' [--both | --fetch | --push] <name> <newurl> [<oldurl>]
+'git remote set-url' [--both | --fetch | --push] '--add' <name> <newurl>
+'git remote set-url' [--both | --fetch | --push] '--delete' <name> <url>
'git remote' [-v | --verbose] 'show' [-n] <name>...
'git remote prune' [-n | --dry-run] <name>...
'git remote' [-v | --verbose] 'update' [-p | --prune] [(<group> | <remote>)...]
@@ -134,7 +134,16 @@ Changes URL remote points to. Sets first URL remote points to matching
regex <oldurl> (first URL if no <oldurl> is given) to <newurl>. If
<oldurl> doesn't match any URL, error occurs and nothing is changed.
+
-With '--push', push URLs are manipulated instead of fetch URLs.
+With '--both', both the fetch and push URLs are manipulated.
++
+With '--fetch', only fetch URLs are manipulated.
++
+With '--push', only push URLs are manipulated.
++
+If none of the '--both', '--fetch' or --push' options are given, then
+'--both' applies only if no push URL was set before. Otherwise '--fetch'
+is assumed for historical reasons. This default may change in the
+future to '--both' to avoid surprises depending on the configuration.
+
With '--add', instead of changing some URL, new URL is added.
+