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

Re: How to merge FETCH_HEAD?

From
Junio C Hamano <junkio@cox.net>
Date
Jan 16, 2007, 20:15 UTC
Message-ID
<7vfyaaybhm.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20070116173706.GB20898@mellanox.co.il>
"Michael S. Tsirkin" <mst@mellanox.co.il> writes:
Show 5 quoted lines
> OK, I did a fetch and now I can see remote history by
>
> $git log FETCH_HEAD
>
> But, how to merge it?

You would do "git merge FETCH_HEAD" (note that this would not work for octopus).

> $ git pull . FETCH_HEAD
> error: no such remote ref refs/heads/FETCH_HEAD
> Fetch failure: .
This is wrong twice.
 (1) "git pull" and "git fetch" by design are to fetch what are
     exposed, and the remote refnames you give are perfixed with
     refs/heads (or refs/tags if you say "git fetch tag v1.0.0")
     unless the refnames begin with refs/ already.  In other
     words, FETCH_HEAD is not something you can "pull".
 (2) Remember, "pull is fetch followed by merge." And the way
     fetch communicates with the calling "pull" so that it can
     drive "merge" is via FETCH_HEAD.  So whatever pull you
     would do, FETCH_HEAD is cleared first to store the result.

So by doing this (and not redoing the fetch) you broke your own experiment sequence. And that is why you got this:

> $git merge FETCH_HEAD
> FETCH_HEAD - not something we can merge
because at this point FETCH_HEAD is empty.
Previous: Michael S. TsirkinNext: Shawn O. Pearce
Message 11 of 19 in “new config option remote.<name>.pushexec”
  1. new config option remote.<name>.pushexecUwe Kleine-König, Jan 16, 2007
  2. Johannes SchindelinJan 16, 2007
  3. Uwe Kleine-KönigJan 16, 2007
  4. How to merge FETCH_HEAD?Michael S. Tsirkin, Jan 16, 2007
  5. Shawn O. PearceJan 16, 2007
  6. Michael S. TsirkinJan 16, 2007
  7. Johannes SchindelinJan 16, 2007
  8. Michael S. TsirkinJan 17, 2007
  9. Junio C HamanoJan 17, 2007
  10. Michael S. TsirkinJan 17, 2007
  11. Junio C HamanoJan 16, 2007
  12. Shawn O. PearceJan 16, 2007
  13. Johannes SchindelinJan 16, 2007
  14. Uwe Kleine-KönigJan 17, 2007
  15. Junio C HamanoJan 17, 2007
  16. Uwe Kleine-KönigJan 18, 2007
  17. make --upload-pack option to git-fetch configurableUwe Kleine-König, Jan 25, 2007
  18. Uwe Kleine-KönigJan 25, 2007
  19. Brian GernhardtJan 16, 2007

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.