From: "Douglas Puchalski (dpuchals)" <dpuchals@cisco.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: [Feature request] Separate explicit fetch mapping from default fetch selection
Date: Thu, 6 Aug 2026 22:26:05 +0000 [thread overview]
Message-ID: <C47215A6-B86F-4AB2-B20D-54D048B9B2BA@cisco.com> (raw)
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
Consequently, the natural checkout command fails:
git checkout -b topic/example origin/topic/example
The documented behavior couples two separate policies in
`remote.<name>.fetch`:
1. Which branches an ordinary `git fetch <remote>` selects automatically.
2. Where an explicitly requested branch is stored locally.
Please provide a configuration or default behavior under which an explicitly
named remote branch is stored as the corresponding remote-tracking ref, while
the remote's automatic fetch set remains restricted.
With that behavior, this sequence would work:
git fetch origin topic/example
git checkout -b topic/example origin/topic/example
It should not require fetching every remote branch, repeating the branch name
in a two-sided refspec, supplying `--refmap`, defining aliases, or handing the
result between commands through FETCH_HEAD. FETCH_HEAD is shared mutable state
and can be overwritten by another fetch between commands.
A backward-compatible opt-in configuration would address existing scripts
that rely on source-only fetches remaining temporary.
Relevant documentation:
https://git-scm <https://git-scm/>.com/docs/git-fetch
next reply other threads:[~2026-08-06 22:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-06 22:26 Douglas Puchalski (dpuchals) [this message]
2026-08-07 2:42 ` [Feature request] Separate explicit fetch mapping from default fetch selection Junio C Hamano
2026-08-07 13:08 ` Phillip Wood
2026-08-07 14:55 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C47215A6-B86F-4AB2-B20D-54D048B9B2BA@cisco.com \
--to=dpuchals@cisco.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox