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

Re: [Feature request] Separate explicit fetch mapping from default fetch selection

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 7, 2026, 02:42 UTC
Message-ID
<xmqqcxvuhcrg.fsf@gitster.g>
In-Reply-To
<C47215A6-B86F-4AB2-B20D-54D048B9B2BA@cisco.com>
"Douglas Puchalski (dpuchals)" <dpuchals@cisco.com> writes:
Show 19 quoted lines
> Git version: 2.55.0
> Environment: macOS 26.6
>
> I configure a remote to fetch only a small default set of branches:
>
>     [remote "origin"]
>         fetch = +refs/heads/main:refs/remotes/origin/main
>         fetch = +refs/heads/team/*:refs/remotes/origin/team/*
>
> This prevents `git fetch origin` from fetching and updating a very large
> number of remote branches.
>
> When I explicitly request another branch:
>
>     git fetch origin topic/example
>
> Git fetches the branch into FETCH_HEAD but does not create or update:
>
>     refs/remotes/origin/topic/example

I haven't thought things through, but I suspect that what you want might be an opposite of explicitly listing what is tracked on remote.*.fetch configuration, but having remotes/origin/* hierarchy of refs as the source of the tracking information.

It was a long ago this was invented, and I haven't used it for almost forever, but shouldn't this

    $ git fetch \
            --refmap="refs/heads/*:refs/remotes/origin/*" \
            origin topic/example

do what you want to do? If so, perhaps it would make a good starting point to make it easier to use (e.g., perhaps a configuration variable can specify the refmap to be used, or something).

Previous: Douglas Puchalski (dpuchals)Next: Phillip Wood
Message 2 of 4 in “[Feature request] Separate explicit fetch mapping from default fetch selection”
  1. Douglas Puchalski (dpuchals)Aug 6, 2026
  2. Junio C HamanoAug 7, 2026
  3. Phillip WoodAug 7, 2026
  4. Junio C HamanoAug 7, 2026

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.