From: Junio C Hamano Date: Thu, 24 Sep 2026 18:02:50 GMT Subject: Re: [PATCH] fetch: add config to avoid fetching every branch in shallow repo Message-ID: In-Reply-To: "D. Ben Knoble" writes: >> Having said that, I suspect that the fact that you have the >> shorthand 'second' (i.e., you have "[remote "second"] url = ..." >> defined) may be a good enough sign that you expect to keep >> interacting with that repository, and some people might appreciate >> it if >> >> $ git fetch second main >> >> created a remote-tracking branch "refs/remotes/second/main" >> automatically. >> >> But we cannot suddenly start doing so without breaking people's >> expectations, and without a good transition plan. We need at least >> an escape hatch for users to say "No, this is a single-shot fetch; >> do not write the object anywhere other than FETCH_HEAD as we have >> always done". > > So anyway, I think fetch..refmap is the right thing here, thanks! Ahh, yes, if we introduce fetch.second.refmap that makes it pretend as if you gave a --refmap argument on the command line, your $ git fetch second main will automatically do what you want it to do. I didn't realize that it was the implication of what I was outlining while preparing the response to Harald ;-) Thanks.