|
16 | 16 | Local directory |
17 | 17 | /path/to/repo.git/ |
18 | 18 |
|
19 | | - In addition to that, as a short-hand, the name of a file |
20 | | - in $GIT_DIR/branches directory can be specified; the |
21 | | - named file should contain a single line, a URL in one of |
22 | | - the above formats, optionally followed by a hash '#' and |
23 | | - the name of remote head. |
24 | | - |
25 | | -<head>:: |
26 | | - The remote head name to fetch from. That is, make the |
27 | | - objects reachable from the commit recorded in |
28 | | - $GIT_DIR/refs/heads/<head> in the remote repository |
29 | | - available locally. |
30 | | - |
31 | | -tag <tag>:: |
32 | | - The remote head tag to fetch from. That is, make the |
33 | | - objects reachable from the commit recorded in |
34 | | - $GIT_DIR/refs/tags/<tag> in the remote repository |
35 | | - available locally. |
| 19 | + In addition to the above, as a short-hand, the name of a |
| 20 | + file in $GIT_DIR/remotes directory can be given; the |
| 21 | + named file should be in the following format: |
36 | 22 |
|
| 23 | + URL: one of the above URL format |
| 24 | + Push: <refspec>... |
| 25 | + Pull: <refspec>... |
| 26 | + |
| 27 | + When such a short-hand is specified in place of |
| 28 | + <repository> without <refspec> parameters on the command |
| 29 | + line, <refspec>... specified on Push lines or Pull lines |
| 30 | + are used for "git push" and "git fetch/pull", |
| 31 | + respectively. |
| 32 | + |
| 33 | + The name of a file in $GIT_DIR/branches directory can be |
| 34 | + specified as an older notation short-hand; the named |
| 35 | + file should contain a single line, a URL in one of the |
| 36 | + above formats, optionally followed by a hash '#' and the |
| 37 | + name of remote head (URL fragment notation). |
| 38 | + $GIT_DIR/branches/<remote> file that stores a <url> |
| 39 | + without the fragment is equivalent to have this in the |
| 40 | + corresponding file in the $GIT_DIR/remotes/ directory |
| 41 | + |
| 42 | + URL: <url> |
| 43 | + Pull: refs/heads/master:<remote> |
| 44 | + |
| 45 | + while having <url>#<head> is equivalent to |
| 46 | + |
| 47 | + URL: <url> |
| 48 | + Pull: refs/heads/<head>:<remote> |
| 49 | + |
| 50 | +<refspec>:: |
| 51 | + The canonical format of a <refspec> parameter is |
| 52 | + +?<src>:<dst>; that is, an optional plus '+', followed |
| 53 | + by the source ref, followed by a colon ':', followed by |
| 54 | + the destination ref. |
| 55 | + |
| 56 | + When used in "git push", the <src> side can be an |
| 57 | + arbitrary "SHA1 expression" that can be used as an |
| 58 | + argument to "git-cat-file -t". E.g. "master~4" (push |
| 59 | + four parents before the current master head). |
| 60 | + |
| 61 | + For "git push", the local ref that matches <src> is used |
| 62 | + to fast forward the remote ref that matches <dst>. If |
| 63 | + the optional plus '+' is used, the remote ref is updated |
| 64 | + even if it does not result in a fast forward update. |
| 65 | + |
| 66 | + For "git fetch/pull", the remote ref that matches <src> |
| 67 | + is fetched, and if <dst> is not empty string, the local |
| 68 | + ref that matches it is fast forwarded using <src>. |
| 69 | + Again, if the optional plus '+' is used, the local ref |
| 70 | + is updated even if it does not result in a fast forward |
| 71 | + update. |
| 72 | + |
| 73 | + Some short-cut notations are also supported. |
| 74 | + |
| 75 | + * For backward compatibility, "tag" is almost ignored; |
| 76 | + it just makes the following parameter <tag> to mean a |
| 77 | + refspec "refs/tags/<tag>:refs/tags/<tag>". |
| 78 | + |
| 79 | + * A parameter <ref> without a colon is equivalent to |
| 80 | + <ref>: when pulling/fetching, and <ref>:<ref> when |
| 81 | + pushing. That is, do not store it locally if |
| 82 | + fetching, and update the same name if pushing. |
0 commit comments