git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 8/9] fetch doc: add a section on configured remote-tracking branches

From
MBMarc Branchaud <mbranchaud@xiplink.com>
Date
Jun 4, 2014, 14:55 UTC
Message-ID
<538F3359.2050601@xiplink.com>
In-Reply-To
<1401833792-2486-9-git-send-email-gitster@pobox.com>
On 14-06-03 06:16 PM, Junio C Hamano wrote:
Show 21 quoted lines
> 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 <gitster@pobox.com>
> ---
>  Documentation/git-fetch.txt | 43 +++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 43 insertions(+)
> 
> diff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt
> index 06106b9..d09736a 100644
> --- a/Documentation/git-fetch.txt
> +++ b/Documentation/git-fetch.txt
> @@ -51,6 +51,49 @@ include::pull-fetch-param.txt[]
>  include::urls-remotes.txt[]
>  
>  
> +CONFIGURED REMOTE-TRACKING BRANCHES
> +-----------------------------------
> +
> +You would often interact with the same remote repository by
s/would//
> +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.<repository>.fetch` configuration variable.
/variable/variables/
Show 11 quoted lines
> +
> +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` command is run without specifying what branches
s/command//
> +  and/or tags to fetch on the command line, e.g. `git fetch origin`
> +  or `git fetch`, the values configured to this variable are used as
s/values configured to this variable/`remote.<repository>.fetch` values/
> +  the refspecs to be used to fetch.  The example above will fetch
/to be used//
> +  all branches that exist on the `origin` (i.e. any ref that matches
s/on/in/
> +  the left-hand side of the value, `refs/heads/*`) and update the
> +  corresponding remote-tracking branches in `refs/remotes/origin/*`
s/in/in the/
> +  hierarchy.
> +
> +* When `git fetch` command is run with explicit branches and/or tags
s/command//
Show 6 quoted lines
> +  to fetch on the command line, e.g. `git fetch origin master`, the
> +  <refspec> given on the command line (e.g. `master` in the example,
> +  which is a short-hand for `master:`, which in turn would mean
> +  "fetch the 'master' branch but I do not explicitly say what
> +  remote-tracking branch to update with it from the command line")
> +  determines what are to be fetched, and the example command will

Change "determines what are to be fetched" to "determines what gets fetched" and move the phrase to before the parenthetical comment.

> +  fetch _only_ the 'master' branch.  The values of the variable are
s/values of the variable/`remote.<repository>.fetch` values/
> +  used to map the branch (i.e. `master`) to determine which
s/used to map the branch (i.e. `master`) to//
> +  remote-tracking branch, if any, is updated.  When used in this
> +  way, the values of the configuration variable do not have any
s/values of the configuration variable/`remote.<repository>.fetch` values/
		M.
Show 10 quoted lines
> +  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
>  --------
>  
> 
Previous: Junio C HamanoNext: Junio C Hamano
Message 13 of 24 in “Clarify two uses of remote.*.fetch”
  1. 0/9 Clarify two uses of remote.*.fetchJunio C Hamano, Jun 3, 2014
  2. 1/9 fetch doc: update introductory part for clarityJunio C Hamano, Jun 3, 2014
  3. 2/9 fetch doc: move FETCH_HEAD material lower and add an exampleJunio C Hamano, Jun 3, 2014
  4. 3/9 fetch doc: update note on '+' in front of the refspecJunio C Hamano, Jun 3, 2014
  5. Michael HaggertyJun 18, 2014
  6. 4/9 fetch doc: remove notes on outdated "mixed layout"Junio C Hamano, Jun 3, 2014
  7. 5/9 fetch doc: on pulling multiple refspecsJunio C Hamano, Jun 3, 2014
  8. Marc BranchaudJun 4, 2014
  9. 6/9 fetch doc: update refspec format descriptionJunio C Hamano, Jun 3, 2014
  10. 7/9 fetch doc: remove "short-cut" sectionJunio C Hamano, Jun 3, 2014
  11. Marc BranchaudJun 4, 2014
  12. 8/9 fetch doc: add a section on configured remote-tracking branchesJunio C Hamano, Jun 3, 2014
  13. Marc BranchaudJun 4, 2014
  14. Junio C HamanoJun 4, 2014
  15. Marc BranchaudJun 5, 2014
  16. docs: Explain the purpose of fetch's and pull's <refspec> parameter.Marc Branchaud, Jun 5, 2014
  17. Junio C HamanoJun 5, 2014
  18. docs: Explain the purpose of fetch's and pull's <refspec> parameter.Marc Branchaud, Jun 11, 2014
  19. 9/9 fetch: allow explicit --refmap to override configurationJunio C Hamano, Jun 3, 2014
  20. Marc BranchaudJun 4, 2014
  21. Junio C HamanoJun 4, 2014
  22. Marc BranchaudJun 5, 2014
  23. Junio C HamanoJun 5, 2014
  24. Michael HaggertyJun 18, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.