summaryrefslogtreecommitdiff
path: root/Documentation/user-manual.txt
diff options
context:
space:
mode:
authorW. Trevor King <wking@tremily.us>2013-02-18 00:15:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-02-18 08:48:42 (GMT)
commit47adb8ac7c550bc89e7eae743dcc8940c2549edf (patch)
treefd63882d031e63763dd952d3d0b100d42fcf5650 /Documentation/user-manual.txt
parentd1471e061657c2e437076947e0e51a3c32adfa60 (diff)
downloadgit-47adb8ac7c550bc89e7eae743dcc8940c2549edf.zip
git-47adb8ac7c550bc89e7eae743dcc8940c2549edf.tar.gz
git-47adb8ac7c550bc89e7eae743dcc8940c2549edf.tar.bz2
user-manual: mention 'git remote add' for remote branch config
I hardly ever setup remote.<name>.url using 'git config'. While it may be instructive to do so, we should also point out 'git remote add'. Signed-off-by: W. Trevor King <wking@tremily.us> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/user-manual.txt')
-rw-r--r--Documentation/user-manual.txt40
1 files changed, 13 insertions, 27 deletions
diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt
index a546b10..c28ba0d 100644
--- a/Documentation/user-manual.txt
+++ b/Documentation/user-manual.txt
@@ -2856,48 +2856,34 @@ branch.master.merge=refs/heads/master
If there are other repositories that you also use frequently, you can
create similar configuration options to save typing; for example,
-after
-------------------------------------------------
-$ git config remote.example.url git://example.com/proj.git
+$ git remote add example git://example.com/proj.git
-------------------------------------------------
-then the following two commands will do the same thing:
+adds the following to `.git/config`:
-------------------------------------------------
-$ git fetch git://example.com/proj.git master:refs/remotes/example/master
-$ git fetch example master:refs/remotes/example/master
+[remote "example"]
+ url = git://example.com/proj.git
+ fetch = +refs/heads/*:refs/remotes/example/*
-------------------------------------------------
-Even better, if you add one more option:
-
--------------------------------------------------
-$ git config remote.example.fetch master:refs/remotes/example/master
--------------------------------------------------
+Also note that the above configuration can be performed by directly
+editing the file `.git/config` instead of using linkgit:git-remote[1].
-then the following commands will all do the same thing:
+After configuring the remote, the following three commands will do the
+same thing:
-------------------------------------------------
-$ git fetch git://example.com/proj.git master:refs/remotes/example/master
-$ git fetch example master:refs/remotes/example/master
+$ git fetch git://example.com/proj.git +refs/heads/*:refs/remotes/example/*
+$ git fetch example +refs/heads/*:refs/remotes/example/*
$ git fetch example
-------------------------------------------------
-You can also add a "+" to force the update each time:
-
--------------------------------------------------
-$ git config remote.example.fetch +master:refs/remotes/example/master
--------------------------------------------------
-
-Don't do this unless you're sure you won't mind "git fetch" possibly
-throwing away commits on 'example/master'.
-
-Also note that all of the above configuration can be performed by
-directly editing the file .git/config instead of using
-linkgit:git-config[1].
-
See linkgit:git-config[1] for more details on the configuration
-options mentioned above.
+options mentioned above and linkgit:git-fetch[1] for more details on
+the refspec syntax.
[[git-concepts]]