Documentation/git-remote.txt: stress that set-url is not for triangular
authorJunio C Hamano <gitster@pobox.com>
Thu, 29 Jan 2015 20:26:09 +0000 (12:26 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 29 Jan 2015 22:07:13 +0000 (14:07 -0800)
It seems to be a common mistake to try using a single remote
(e.g. 'origin') to fetch from one place (i.e. upstream) while
pushing to another (i.e. your publishing point).

That will never work satisfactorily, and it is easy to understand
why if you think about what refs/remotes/origin/* would mean in such
a world. It fundamentally cannot reflect the reality. If it
follows the state of your upstream, it cannot match what you have
published, and vice versa.

It may be that misinformation is spread by some people. Let's
counter them by adding a few words to our documentation.

- The description was referring to <oldurl> and <newurl>, but never
mentioned <name> argument you give from the command line. By
mentioning "remote <name>", stress the fact that it is configuring
a single remote.

- Add a reminder that explicitly states that this is about a single
remote, which the triangular workflow is not about.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-remote.txt
index cb103c8b6f8fe4fd89ad5e1a37b551f9f54d75c7..a77607b852c1f9cbcea7b9d1a359e5c467933aa0 100644 (file)
@@ -130,17 +130,25 @@ branches, adds to that list.
 
 'set-url'::
 
-Changes URL remote points to. Sets first URL remote points to matching
+Changes URLs for the remote. Sets first URL for remote <name> that matches
 regex <oldurl> (first URL if no <oldurl> is given) to <newurl>. If
-<oldurl> doesn't match any URL, error occurs and nothing is changed.
+<oldurl> doesn't match any URL, an error occurs and nothing is changed.
 +
 With '--push', push URLs are manipulated instead of fetch URLs.
 +
-With '--add', instead of changing some URL, new URL is added.
+With '--add', instead of changing existing URLs, new URL is added.
 +
-With '--delete', instead of changing some URL, all URLs matching
-regex <url> are deleted. Trying to delete all non-push URLs is an
-error.
+With '--delete', instead of changing existing URLs, all URLs matching
+regex <url> are deleted for remote <name>.  Trying to delete all
+non-push URLs is an error.
++
+Note that the push URL and the fetch URL, even though they can
+be set differently, must still refer to the same place.  What you
+pushed to the push URL should be what you would see if you
+immediately fetched from the fetch URL.  If you are trying to
+fetch from one place (e.g. your upstream) and push to another (e.g.
+your publishing repository), use two separate remotes.
+
 
 'show'::