From 532845604de9b3fe7c651fe2546f20043b8cd7c1 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 29 May 2014 12:36:47 -0700 Subject: fetch doc: update introductory part for clarity - "Branches" is a more common way to say "heads" in these days. - Remote-tracking branches are used a lot more these days and it is worth mentioning that it is one of the primary side effects of the command to update them. - Avoid "X. That means Y." If Y is easier to understand to readers, just say that upfront. - Use of explicit refspec to fetch tags does not have much to do with turning "auto following" on or off. It is a way to fetch tags that otherwise would not be fetched by auto-following. Helped-by: Marc Branchaud Signed-off-by: Junio C Hamano --- Documentation/git-fetch.txt | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt index 5809aa4eb9..78fe9489e6 100644 --- a/Documentation/git-fetch.txt +++ b/Documentation/git-fetch.txt @@ -17,20 +17,22 @@ SYNOPSIS DESCRIPTION ----------- -Fetches named heads or tags from one or more other repositories, -along with the objects necessary to complete them. +Fetch branches and/or tags (collectively, "refs") from one or more +other repositories, along with the objects necessary to complete +their histories. -The ref names and their object names of fetched refs are stored -in `.git/FETCH_HEAD`. This information is left for a later merge -operation done by 'git merge'. +The names of refs that are fetched, together with the object names +they point at, are written to `.git/FETCH_HEAD`. This information +can be used to learn what was fetched. In addition, the remote-tracking +branches are updated (see description on below for details). -By default, tags are auto-followed. This means that when fetching -from a remote, any tags on the remote that point to objects that exist -in the local repository are fetched. The effect is to fetch tags that +By default, any tag that points into the histories being fetched is +also fetched; the effect is to fetch tags that point at branches that you are interested in. This default behavior -can be changed by using the --tags or --no-tags options, by -configuring remote..tagopt, or by using a refspec that fetches -tags explicitly. +can be changed by using the --tags or --no-tags options or by +configuring remote..tagopt. By using a refspec that fetches tags +explicitly, you can fetch tags that do not point into branches you +are interested in as well. 'git fetch' can fetch from either a single named repository, or from several repositories at once if is given and -- cgit v1.2.3 From 366a0184e550200bf80fb76217b8655b54b1fd6c Mon Sep 17 00:00:00 2001 From: Marc Branchaud Date: Mon, 2 Jun 2014 11:21:47 -0400 Subject: fetch doc: move FETCH_HEAD material lower and add an example Signed-off-by: Marc Branchaud Signed-off-by: Junio C Hamano --- Documentation/git-fetch.txt | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt index 78fe9489e6..06106b9b0c 100644 --- a/Documentation/git-fetch.txt +++ b/Documentation/git-fetch.txt @@ -18,13 +18,9 @@ SYNOPSIS DESCRIPTION ----------- Fetch branches and/or tags (collectively, "refs") from one or more -other repositories, along with the objects necessary to complete -their histories. - -The names of refs that are fetched, together with the object names -they point at, are written to `.git/FETCH_HEAD`. This information -can be used to learn what was fetched. In addition, the remote-tracking -branches are updated (see description on below for details). +other repositories, along with the objects necessary to complete their +histories. Remote-tracking branches are updated (see the description +of below for ways to control this behavior). By default, any tag that points into the histories being fetched is also fetched; the effect is to fetch tags that @@ -34,7 +30,7 @@ configuring remote..tagopt. By using a refspec that fetches tags explicitly, you can fetch tags that do not point into branches you are interested in as well. -'git fetch' can fetch from either a single named repository, +'git fetch' can fetch from either a single named repository or URL, or from several repositories at once if is given and there is a remotes. entry in the configuration file. (See linkgit:git-config[1]). @@ -42,6 +38,10 @@ there is a remotes. entry in the configuration file. When no remote is specified, by default the `origin` remote will be used, unless there's an upstream branch configured for the current branch. +The names of refs that are fetched, together with the object names +they point at, are written to `.git/FETCH_HEAD`. This information +may be used by scripts or other git commands, such as linkgit:git-pull[1]. + OPTIONS ------- include::fetch-options.txt[] @@ -78,6 +78,19 @@ the local repository by fetching from the branches (respectively) The `pu` branch will be updated even if it is does not fast-forward, because it is prefixed with a plus sign; `tmp` will not be. +* Peek at a remote's branch, without configuring the remote in your local +repository: ++ +------------------------------------------------ +$ git fetch git://git.kernel.org/pub/scm/git/git.git maint +$ git log FETCH_HEAD +------------------------------------------------ ++ +The first command fetches the `maint` branch from the repository at +`git://git.kernel.org/pub/scm/git/git.git` and the second command uses +`FETCH_HEAD` to examine the branch with linkgit:git-log[1]. The fetched +objects will eventually be removed by git's built-in housekeeping (see +linkgit:git-gc[1]). BUGS ---- -- cgit v1.2.3 From f471dbc5feeefd3a761f311d3efa7b1a987bcb13 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 29 May 2014 12:53:28 -0700 Subject: fetch doc: update note on '+' in front of the refspec While it is not *wrong* per-se to say that pulling a rewound/rebased branch will lead to an unnecessary merge conflict, that is not what the leading "+" sign to allow non-fast-forward update of remote-tracking branch is at all. Helped-by: Marc Branchaud Signed-off-by: Junio C Hamano --- Documentation/pull-fetch-param.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt index 18cffc25b8..41474c5dc7 100644 --- a/Documentation/pull-fetch-param.txt +++ b/Documentation/pull-fetch-param.txt @@ -24,15 +24,15 @@ is updated even if it does not result in a fast-forward update. + [NOTE] -If the remote branch from which you want to pull is -modified in non-linear ways such as being rewound and -rebased frequently, then a pull will attempt a merge with -an older version of itself, likely conflict, and fail. -It is under these conditions that you would want to use -the `+` sign to indicate non-fast-forward updates will -be needed. There is currently no easy way to determine -or declare that a branch will be made available in a -repository with this behavior; the pulling user simply +When the remote branch you want to fetch is known to +be rewound and rebased regularly, it is expected that +its new tip will not be descendant of its previous tip +(as stored in your remote-tracking branch the last time +you fetched). You would want +to use the `+` sign to indicate non-fast-forward updates +will be needed for such branches. There is no way to +determine or declare that a branch will be made available +in a repository with this behavior; the pulling user simply must know this is the expected usage pattern for a branch. + [NOTE] -- cgit v1.2.3 From 3630654956b75b10ae19211599e08257cd4c3f8d Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 29 May 2014 12:55:50 -0700 Subject: fetch doc: remove notes on outdated "mixed layout" In old days before Git 1.5, it was customery for "git fetch" to use the same local branch namespace to keep track of the remote-tracking branches, and it was necessary to tell users not to check them out and commit on them. Since everybody uses the separate remote layout these days, there is no need to warn against the practice to check out the right-hand side of and build on it---the RHS is typically not even a local branch. Incidentally, this also kills one mention of "Pull:" line of $GIT_DIR/remotes/* configuration, which is a lot less familiar to new people than the more modern remote.*.fetch configuration variable. Signed-off-by: Junio C Hamano --- Documentation/pull-fetch-param.txt | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt index 41474c5dc7..40f868756d 100644 --- a/Documentation/pull-fetch-param.txt +++ b/Documentation/pull-fetch-param.txt @@ -36,19 +36,6 @@ in a repository with this behavior; the pulling user simply must know this is the expected usage pattern for a branch. + [NOTE] -You never do your own development on branches that appear -on the right hand side of a colon on `Pull:` lines; -they are to be updated by 'git fetch'. If you intend to do -development derived from a remote branch `B`, have a `Pull:` -line to track it (i.e. `Pull: B:remote-B`), and have a separate -branch `my-B` to do your development on top of it. The latter -is created by `git branch my-B remote-B` (or its equivalent `git -checkout -b my-B remote-B`). Run `git fetch` to keep track of -the progress of the remote side, and when you see something new -on the remote branch, merge it into your development branch with -`git pull . remote-B`, while you are on `my-B` branch. -+ -[NOTE] There is a difference between listing multiple directly on 'git pull' command line and having multiple `Pull:` lines for a and running -- cgit v1.2.3 From 5d59a32fa1b579f5dd8ef1449bd3f1945f235915 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 29 May 2014 13:07:44 -0700 Subject: fetch doc: on pulling multiple refspecs Replace desription of old-style "Pull:" lines in remotes/ configuration with modern remote.*.fetch variables. As this note applies only to "git pull", enable it only in git-pull manual page. Signed-off-by: Junio C Hamano --- Documentation/pull-fetch-param.txt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt index 40f868756d..9cb78d4f75 100644 --- a/Documentation/pull-fetch-param.txt +++ b/Documentation/pull-fetch-param.txt @@ -34,22 +34,27 @@ will be needed for such branches. There is no way to determine or declare that a branch will be made available in a repository with this behavior; the pulling user simply must know this is the expected usage pattern for a branch. +ifdef::git-pull[] + [NOTE] There is a difference between listing multiple directly on 'git pull' command line and having multiple -`Pull:` lines for a and running +`remote..fetch` entries in your configuration +for a and running a 'git pull' command without any explicit parameters. - listed explicitly on the command line are always +s listed explicitly on the command line are always merged into the current branch after fetching. In other words, -if you list more than one remote refs, you would be making -an Octopus. While 'git pull' run without any explicit -parameter takes default s from `Pull:` lines, it -merges only the first found into the current branch, -after fetching all the remote refs. This is because making an +if you list more than one remote ref, 'git pull' will create +an Octopus merge. On the other hand, if you do not list any +explicit parameter on the command line, 'git pull' +will fetch all the s it finds in the +`remote..fetch` configuration and merge +only the first found into the current branch. +This is because making an Octopus from remote refs is rarely done, while keeping track of multiple remote heads in one-go by fetching more than one is often useful. +endif::git-pull[] + Some short-cut notations are also supported. + -- cgit v1.2.3 From b8bdaa97a6447a1a1f9e635e6e2212858fdfe572 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 29 May 2014 13:28:21 -0700 Subject: fetch doc: update refspec format description The text made it sound as if the leading plus is the only thing that is optional, and forgot that is the same as :, i.e. fetch it and do not store anywhere. Signed-off-by: Junio C Hamano --- Documentation/pull-fetch-param.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt index 9cb78d4f75..b5a356b8f6 100644 --- a/Documentation/pull-fetch-param.txt +++ b/Documentation/pull-fetch-param.txt @@ -15,6 +15,7 @@ endif::git-pull[] The format of a parameter is an optional plus `+`, followed by the source ref , followed by a colon `:`, followed by the destination ref . + The colon can be omitted when is empty. + The remote ref that matches is fetched, and if is not empty string, the local -- cgit v1.2.3 From 5cc3268720bd64f7dcc11843060fcebbe84f1a39 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 29 May 2014 13:22:01 -0700 Subject: fetch doc: remove "short-cut" section It is misleading to mention that that does not store is to fetch the ref into FETCH_HEAD, because a refspec that does store is also to fetch the LHS into FETCH_HEAD. It is doubly misleading to list it as part of "short-cut". stands for a refspec that has it on the LHS with a colon and an empty RHS, and that definition should be given at the beginning of the entry where the format is defined. Tentatively remove this misleading description, which leaves the `tag ` as the only true short-hand, so move it at the beginning of the entry. Signed-off-by: Junio C Hamano --- Documentation/pull-fetch-param.txt | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt index b5a356b8f6..4bff65b0e9 100644 --- a/Documentation/pull-fetch-param.txt +++ b/Documentation/pull-fetch-param.txt @@ -17,6 +17,9 @@ endif::git-pull[] by a colon `:`, followed by the destination ref . The colon can be omitted when is empty. + +`tag ` means the same as `refs/tags/:refs/tags/`; +it requests fetching everything up to the given tag. ++ The remote ref that matches is fetched, and if is not empty string, the local ref that matches it is fast-forwarded using . @@ -56,16 +59,3 @@ Octopus from remote refs is rarely done, while keeping track of multiple remote heads in one-go by fetching more than one is often useful. endif::git-pull[] -+ -Some short-cut notations are also supported. -+ -* `tag ` means the same as `refs/tags/:refs/tags/`; - it requests fetching everything up to the given tag. -ifndef::git-pull[] -* A parameter without a colon fetches that ref into FETCH_HEAD, -endif::git-pull[] -ifdef::git-pull[] -* A parameter without a colon merges into the current - branch, -endif::git-pull[] - and updates the remote-tracking branches (if any). -- cgit v1.2.3 From fcb14b0c8d7a732b1d26b5fda18f730851a76eed Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 29 May 2014 14:24:23 -0700 Subject: fetch doc: add a section on configured remote-tracking branches To resurrect a misleading mention removed in the previous step, add a section to explain how the remote-tracking configuration interacts with the refspecs given as the command-line arguments. Signed-off-by: Junio C Hamano --- Documentation/git-fetch.txt | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt index 06106b9b0c..7f818c348b 100644 --- a/Documentation/git-fetch.txt +++ b/Documentation/git-fetch.txt @@ -51,6 +51,51 @@ include::pull-fetch-param.txt[] include::urls-remotes.txt[] +CONFIGURED REMOTE-TRACKING BRANCHES +----------------------------------- + +You often interact with the same remote repository by +regularly and repeatedly fetching from it. In order to keep track +of the progress of such a remote repository, `git fetch` allows you +to configure `remote..fetch` configuration variables. + +Typically such a variable may look like this: + +------------------------------------------------ +[remote "origin"] + fetch = +refs/heads/*:refs/remotes/origin/* +------------------------------------------------ + +This configuration is used in two ways: + +* When `git fetch` is run without specifying what branches + and/or tags to fetch on the command line, e.g. `git fetch origin` + or `git fetch`, `remote..fetch` values are used as + the refspecs---they specify which refs to fetch and which local refs + to update. The example above will fetch + all branches that exist in the `origin` (i.e. any ref that matches + the left-hand side of the value, `refs/heads/*`) and update the + corresponding remote-tracking branches in the `refs/remotes/origin/*` + hierarchy. + +* When `git fetch` is run with explicit branches and/or tags + to fetch on the command line, e.g. `git fetch origin master`, the + s given on the command line determine what are to be + fetched (e.g. `master` in the example, + which is a short-hand for `master:`, which in turn means + "fetch the 'master' branch but I do not explicitly say what + remote-tracking branch to update with it from the command line"), + and the example command will + fetch _only_ the 'master' branch. The `remote..fetch` + values determine which + remote-tracking branch, if any, is updated. When used in this + way, the `remote..fetch` values do not have any + effect in deciding _what_ gets fetched (i.e. the values are not + used as refspecs when the command-line lists refspecs); they are + only used to decide _where_ the refs that are fetched are stored + by acting as a mapping. + + EXAMPLES -------- -- cgit v1.2.3 From c5558f80c3a34f411022f1bc67f8364556ca3922 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 29 May 2014 15:21:31 -0700 Subject: fetch: allow explicit --refmap to override configuration Since the introduction of opportunisitic updates of remote-tracking branches, started at around f2690487 (fetch: opportunistically update tracking refs, 2013-05-11) with a few updates in v1.8.4 era, the remote.*.fetch configuration always kicks in even when a refspec to specify what to fetch is given on the command line, and there is no way to disable or override it per-invocation. Teach the command to pay attention to the --refmap=: command-line options that can be used to override the use of configured remote.*.fetch as the refmap. Signed-off-by: Junio C Hamano --- --- Documentation/fetch-options.txt | 8 ++++++++ Documentation/git-fetch.txt | 4 ++++ builtin/fetch.c | 35 ++++++++++++++++++++++++++++++++--- t/t5510-fetch.sh | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+), 3 deletions(-) diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt index 92c68c3fda..b09a783ee3 100644 --- a/Documentation/fetch-options.txt +++ b/Documentation/fetch-options.txt @@ -72,6 +72,14 @@ endif::git-pull[] setting. See linkgit:git-config[1]. ifndef::git-pull[] +--refmap=:: + When fetching refs listed on the command line, use the + specified refspec (can be given more than once) to map the + refs to remote-tracking branches, instead of the values of + `remote.*.fetch` configuration variables for the remote + repository. See section on "Configured Remote-tracking + Branches" for details. + -t:: --tags:: Fetch all tags from the remote (i.e., fetch remote tags diff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt index 7f818c348b..629a1cfe00 100644 --- a/Documentation/git-fetch.txt +++ b/Documentation/git-fetch.txt @@ -95,6 +95,10 @@ This configuration is used in two ways: only used to decide _where_ the refs that are fetched are stored by acting as a mapping. +The latter use of the `remote..fetch` values can be +overridden by giving the `--refmap=` parameter(s) on the +command line. + EXAMPLES -------- diff --git a/builtin/fetch.c b/builtin/fetch.c index 55f457c04f..dd46b61d9a 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -45,6 +45,8 @@ static struct transport *gsecondary; static const char *submodule_prefix = ""; static const char *recurse_submodules_default; static int shown_url = 0; +static int refmap_alloc, refmap_nr; +static const char **refmap_array; static int option_parse_recurse_submodules(const struct option *opt, const char *arg, int unset) @@ -69,6 +71,19 @@ static int git_fetch_config(const char *k, const char *v, void *cb) return 0; } +static int parse_refmap_arg(const struct option *opt, const char *arg, int unset) +{ + ALLOC_GROW(refmap_array, refmap_nr + 1, refmap_alloc); + + /* + * "git fetch --refmap='' origin foo" + * can be used to tell the command not to store anywhere + */ + if (*arg) + refmap_array[refmap_nr++] = arg; + return 0; +} + static struct option builtin_fetch_options[] = { OPT__VERBOSITY(&verbosity), OPT_BOOL(0, "all", &all, @@ -107,6 +122,8 @@ static struct option builtin_fetch_options[] = { N_("default mode for recursion"), PARSE_OPT_HIDDEN }, OPT_BOOL(0, "update-shallow", &update_shallow, N_("accept refs that update .git/shallow")), + { OPTION_CALLBACK, 0, "refmap", NULL, N_("refmap"), + N_("specify fetch refmap"), PARSE_OPT_NONEG, parse_refmap_arg }, OPT_END() }; @@ -278,6 +295,9 @@ static struct ref *get_ref_map(struct transport *transport, const struct ref *remote_refs = transport_get_remote_refs(transport); if (refspec_count) { + struct refspec *fetch_refspec; + int fetch_refspec_nr; + for (i = 0; i < refspec_count; i++) { get_fetch_map(remote_refs, &refspecs[i], &tail, 0); if (refspecs[i].dst && refspecs[i].dst[0]) @@ -307,12 +327,21 @@ static struct ref *get_ref_map(struct transport *transport, * by ref_remove_duplicates() in favor of one of these * opportunistic entries with FETCH_HEAD_IGNORE. */ - for (i = 0; i < transport->remote->fetch_refspec_nr; i++) - get_fetch_map(ref_map, &transport->remote->fetch[i], - &oref_tail, 1); + if (refmap_array) { + fetch_refspec = parse_fetch_refspec(refmap_nr, refmap_array); + fetch_refspec_nr = refmap_nr; + } else { + fetch_refspec = transport->remote->fetch; + fetch_refspec_nr = transport->remote->fetch_refspec_nr; + } + + for (i = 0; i < fetch_refspec_nr; i++) + get_fetch_map(ref_map, &fetch_refspec[i], &oref_tail, 1); if (tags == TAGS_SET) get_fetch_map(remote_refs, tag_refspec, &tail, 0); + } else if (refmap_array) { + die("--refmap option is only meaningful with command-line refspec(s)."); } else { /* Use the defaults */ struct remote *remote = transport->remote; diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index 29d59ef9fa..d78f3201f4 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -447,6 +447,43 @@ test_expect_success 'explicit pull should update tracking' ' ) ' +test_expect_success 'explicit --refmap is allowed only with command-line refspec' ' + cd "$D" && + ( + cd three && + test_must_fail git fetch --refmap="*:refs/remotes/none/*" + ) +' + +test_expect_success 'explicit --refmap option overrides remote.*.fetch' ' + cd "$D" && + git branch -f side && + ( + cd three && + git update-ref refs/remotes/origin/master base-origin-master && + o=$(git rev-parse --verify refs/remotes/origin/master) && + git fetch --refmap="refs/heads/*:refs/remotes/other/*" origin master && + n=$(git rev-parse --verify refs/remotes/origin/master) && + test "$o" = "$n" && + test_must_fail git rev-parse --verify refs/remotes/origin/side && + git rev-parse --verify refs/remotes/other/master + ) +' + +test_expect_success 'explicitly empty --refmap option disables remote.*.fetch' ' + cd "$D" && + git branch -f side && + ( + cd three && + git update-ref refs/remotes/origin/master base-origin-master && + o=$(git rev-parse --verify refs/remotes/origin/master) && + git fetch --refmap="" origin master && + n=$(git rev-parse --verify refs/remotes/origin/master) && + test "$o" = "$n" && + test_must_fail git rev-parse --verify refs/remotes/origin/side + ) +' + test_expect_success 'configured fetch updates tracking' ' cd "$D" && -- cgit v1.2.3 From db4e4113ea33ece52c5988f9b9f7c0559c802602 Mon Sep 17 00:00:00 2001 From: Marc Branchaud Date: Wed, 11 Jun 2014 10:24:04 -0400 Subject: docs: Explain the purpose of fetch's and pull's parameter. Signed-off-by: Marc Branchaud Signed-off-by: Junio C Hamano --- Documentation/git-fetch.txt | 4 ++-- Documentation/pull-fetch-param.txt | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt index 629a1cfe00..8deb61469d 100644 --- a/Documentation/git-fetch.txt +++ b/Documentation/git-fetch.txt @@ -51,8 +51,8 @@ include::pull-fetch-param.txt[] include::urls-remotes.txt[] -CONFIGURED REMOTE-TRACKING BRANCHES ------------------------------------ +CONFIGURED REMOTE-TRACKING BRANCHES[[CRTB]] +------------------------------------------- You often interact with the same remote repository by regularly and repeatedly fetching from it. In order to keep track diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt index 4bff65b0e9..1ebbf1d738 100644 --- a/Documentation/pull-fetch-param.txt +++ b/Documentation/pull-fetch-param.txt @@ -12,10 +12,20 @@ ifndef::git-pull[] endif::git-pull[] :: - The format of a parameter is an optional plus - `+`, followed by the source ref , followed - by a colon `:`, followed by the destination ref . - The colon can be omitted when is empty. + Specifies which refs to fetch and which local refs to update. + When no s appear on the command line, the refs to fetch + are read from `remote..fetch` variables instead +ifndef::git-pull[] + (see <> below). +endif::git-pull[] +ifdef::git-pull[] + (see linkgit:git-fetch[1]). +endif::git-pull[] ++ +The format of a parameter is an optional plus +`+`, followed by the source ref , followed +by a colon `:`, followed by the destination ref . +The colon can be omitted when is empty. + `tag ` means the same as `refs/tags/:refs/tags/`; it requests fetching everything up to the given tag. -- cgit v1.2.3