Merge with master.kernel.org:/pub/scm/git/git.git
[git.git] / Documentation / pull-fetch-param.txt
1 <repository>::
2         The "remote" repository to pull from.  One of the
3         following notations can be used to name the repository
4         to pull from:
5 +
6 ===============================================================
7 - Rsync URL:            rsync://remote.machine/path/to/repo.git/
8 - HTTP(s) URL:          http://remote.machine/path/to/repo.git/
9 - GIT URL:              git://remote.machine/path/to/repo.git/
10                         or remote.machine:/path/to/repo.git/
11 - Local directory:      /path/to/repo.git/
12 ===============================================================
13 +
14 In addition to the above, as a short-hand, the name of a
15 file in $GIT_DIR/remotes directory can be given; the
16 named file should be in the following format:
17 +
18         URL: one of the above URL format
19         Push: <refspec>...
20         Pull: <refspec>...
21 +
22 When such a short-hand is specified in place of
23 <repository> without <refspec> parameters on the command
24 line, <refspec>... specified on Push lines or Pull lines
25 are used for "git push" and "git fetch/pull",
26 respectively.
27 +
28 The name of a file in $GIT_DIR/branches directory can be
29 specified as an older notation short-hand; the named
30 file should contain a single line, a URL in one of the
31 above formats, optionally followed by a hash '#' and the
32 name of remote head (URL fragment notation).
33 $GIT_DIR/branches/<remote> file that stores a <url>
34 without the fragment is equivalent to have this in the
35 corresponding file in the $GIT_DIR/remotes/ directory
36 +
37         URL: <url>
38         Pull: refs/heads/master:<remote>
39 +
40 while having <url>#<head> is equivalent to
41 +
42         URL: <url>
43         Pull: refs/heads/<head>:<remote>
44
45 <refspec>::
46         The canonical format of a <refspec> parameter is
47         '+?<src>:<dst>'; that is, an optional plus '+', followed
48         by the source ref, followed by a colon ':', followed by
49         the destination ref.
50 +
51 When used in "git push", the <src> side can be an
52 arbitrary "SHA1 expression" that can be used as an
53 argument to "git-cat-file -t".  E.g. "master~4" (push
54 four parents before the current master head).
55 +
56 For "git push", the local ref that matches <src> is used
57 to fast forward the remote ref that matches <dst>.  If
58 the optional plus '+' is used, the remote ref is updated
59 even if it does not result in a fast forward update.
60 +
61 For "git fetch/pull", the remote ref that matches <src>
62 is fetched, and if <dst> is not empty string, the local
63 ref that matches it is fast forwarded using <src>.
64 Again, if the optional plus '+' is used, the local ref
65 is updated even if it does not result in a fast forward
66 update.
67 +
68 Some short-cut notations are also supported.
69 +
70 * For backward compatibility, "tag" is almost ignored;
71   it just makes the following parameter <tag> to mean a
72   refspec "refs/tags/<tag>:refs/tags/<tag>".
73 * A parameter <ref> without a colon is equivalent to
74   <ref>: when pulling/fetching, and <ref>:<ref> when
75   pushing.  That is, do not store it locally if
76   fetching, and update the same name if pushing.
77
78 -a, \--append::
79         Append ref names and object names of fetched refs to the
80         existing contents of $GIT_DIR/FETCH_HEAD.  Without this
81         option old data in $GIT_DIR/FETCH_HEAD will be overwritten.
82
83 -f, \--force::
84         Usually, the command refuses to update a local ref that is
85         not an ancestor of the remote ref used to overwrite it.
86         This flag disables the check.  What this means is that the
87         local repository can lose commits; use it with care.