diff options
authorJunio C Hamano <>2005-07-16 07:17:42 (GMT)
committerLinus Torvalds <>2005-07-16 16:23:06 (GMT)
commit0c04094bc153ef1073524267b4eb49989c7b8ccb (patch)
parentf170e4b39d87365cda17b80436ba6db4a2044e88 (diff)
[PATCH] Documentation: describe short-hand used in fetch/pull.
Describe short-hand for remote repository used in fetch/pull. Signed-off-by: Junio C Hamano <> Signed-off-by: Linus Torvalds <>
5 files changed, 130 insertions, 6 deletions
diff --git a/Documentation/git-fetch-script.txt b/Documentation/git-fetch-script.txt
new file mode 100644
index 0000000..937df05
--- /dev/null
+++ b/Documentation/git-fetch-script.txt
@@ -0,0 +1,47 @@
+v0.1, July 2005
+git-fetch-script - Download objects and a head from another repository.
+'git-fetch-script' <repository> [ <head> | tag <tag> ]
+Fetches a named head or a tag from another repository, along
+with the objects necessary to complete that head or tag. The
+head to pull defaults to HEAD if unspecified. The head or tag
+fetched from the remote repository is stored in
+When a <tag> is specified, the <tag> fetched from the remote is
+also copied to the local $GIT_DIR/tags/<tag> file. When no
+<head> nor <tag> is specified, and <repository> was specified
+with the short-hand notation (i.e. naming a file under the
+$GIT_DIR/branches directory), the head fetched from the remote
+repository is also copied to the local $GIT_DIR/heads/<repository>
+Written by Linus Torvalds <> and Junio C Hamano <>
+Documentation by David Greaves, Junio C Hamano and the git-list <>.
+Part of the link:git.html[git] suite
diff --git a/Documentation/git-pull-script.txt b/Documentation/git-pull-script.txt
index 44fd09a..ec1e7a2 100644
--- a/Documentation/git-pull-script.txt
+++ b/Documentation/git-pull-script.txt
@@ -4,22 +4,28 @@ v0.1, May 2005
-git-pull-script - Script used by Linus to pull and merge a remote repository
+git-pull-script - Pull and merge from another repository.
+'git-pull-script' <repository> [ <head> | tag <tag> ]
-This script is used by Linus to pull from a remote repository and perform
-a merge.
+Runs 'git-fetch-script' with the given parameters, then
+'git-resolve-script' to merge the local HEAD and FETCH_HEAD.
-Written by Linus Torvalds <>
+Written by Linus Torvalds <> and Junio C Hamano <>
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 916a0b7..ffc27d5 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -121,6 +121,9 @@ The interrogate commands may create files - and you can force them to
touch the working file set - but in general they don't
+Synching repositories
Clones a repository into the current repository (user interface)
@@ -128,10 +131,14 @@ link:git-clone-pack.html[git-clone-pack]::
Clones a repository into the current repository (engine
for ssh and local transport)
Pull from a repote repository via various protocols
(user interface).
+ Fetch from and merge with a repote repository via
+ various protocols (user interface).
Downloads a remote GIT repository via HTTP
diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt
new file mode 100644
index 0000000..7ae4ba0
--- /dev/null
+++ b/Documentation/pull-fetch-param.txt
@@ -0,0 +1,36 @@
+ The "remote" repository to pull from. One of the
+ following notations can be used to name the repository
+ to pull from:
+ Rsync URL
+ rsync://remote.machine/path/to/repo.git/
+ http://remote.machine/path/to/repo.git/
+ git://remote.machine/path/to/repo.git/
+ remote.machine:/path/to/repo.git/
+ Local directory
+ /path/to/repo.git/
+ In addition to that, as a short-hand, the name of a file
+ in $GIT_DIR/branches directory can be specified; the
+ named file should contain a single line, a URL in one of
+ the above formats, optionally followed by a hash '#' and
+ the name of remote head.
+ The remote head name to fetch from. That is, make the
+ objects reachable from the commit recorded in
+ $GIT_DIR/refs/heads/<head> in the remote repository
+ available locally.
+tag <tag>::
+ The remote head tag to fetch from. That is, make the
+ objects reachable from the commit recorded in
+ $GIT_DIR/refs/tags/<tag> in the remote repository
+ available locally.
diff --git a/Documentation/tutorial.txt b/Documentation/tutorial.txt
index 8088fd3..925ef2c 100644
--- a/Documentation/tutorial.txt
+++ b/Documentation/tutorial.txt
@@ -810,6 +810,34 @@ pull from:
course, you will pay the price of more disk usage to hold
multiple working trees, but disk space is cheap these days. ]
+It is likely that you will be pulling from the same remote
+repository from time to time. As a short hand, you can store
+the remote repository URL in a file under .git/branches/
+directory, like this:
+ mkdir -p .git/branches
+ echo rsync:// \
+ >.git/branches/linus
+and use the filenae to "git pull" instead of the full URL.
+The contents of a file under .git/branches can even be a prefix
+of a full URL, like this:
+ echo rsync://
+ >.git/branches/jgarzik
+ (1) git pull linus
+ (2) git pull linus tag v0.99.1
+ (3) git pull jgarzik/netdev-2.6.git/ e100
+the above are equivalent to:
+ (1) git pull rsync:// HEAD
+ (2) git pull rsync:// tag v0.99.1
+ (3) git pull rsync:// e100
Publishing your work