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

Re: What is the default refspec for fetch?

From
Christian Halstrick <christian.halstrick@gmail.com>
Date
Nov 11, 2014, 23:01 UTC
Message-ID
<CAENte7ggGPgNktH_ArVsjN2yDLADHQApDCzWbQLo_bbCiduk6w@mail.gmail.com>
In-Reply-To
<xmqq7fz4e18x.fsf@gitster.dls.corp.google.com>
ok, thanks. Then I'll teach JGit to fetch at least "HEAD" if nothing
is configured and nothing explicitly specified as refspec.
Ciao
  Chris
On Sun, Nov 9, 2014 at 6:23 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 27 quoted lines
> Jakub Narębski <jnareb@gmail.com> writes:
>
>> W dniu 2014-11-08 11:52, Jeff King pisze:
>>> On Fri, Nov 07, 2014 at 04:31:08PM +0100, Christian Halstrick wrote:
>>>
>>>> In a repo where no remote.<name>.fetch config parameter is set what
>>>> should a "git fetch" do? My experiments let me think it's
>>>> "HEAD:FETCH_HEAD". Right?
>>>
>>> Basically, yes. We always write FETCH_HEAD, regardless of the refspec.
>>> We choose "HEAD" if no other refspec was provided. So it is really more
>>> like
>>>
>>>    git fetch $remote HEAD
>>>
>>> This is what makes one-off bare-url pulls work, like:
>>>
>>>    git pull git://...
>>>
>>> It runs fetch under the hood, which writes into FETCH_HEAD, and then we
>>> merge that.
>>
>> Actually FETCH_HEAD consists of multiple lines, one per ref...
>> but only top ref is merged.
>
> Incorrect in that "only top" is misinformation, and irrelevant in
> the context of discussing the "what is fetched in a one-off fetch".
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 6 in “What is the default refspec for fetch?”
  1. Christian HalstrickNov 7, 2014
  2. Jeff KingNov 8, 2014
  3. Jakub NarębskiNov 8, 2014
  4. Junio C HamanoNov 9, 2014
  5. Christian HalstrickNov 11, 2014
  6. Junio C HamanoNov 11, 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.