From: Junio C Hamano <junkio@cox.net>
To: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: git@vger.kernel.org
Subject: Re: How to merge FETCH_HEAD?
Date: Tue, 16 Jan 2007 12:15:17 -0800 [thread overview]
Message-ID: <7vfyaaybhm.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <20070116173706.GB20898@mellanox.co.il> (Michael S. Tsirkin's message of "Tue, 16 Jan 2007 19:37:18 +0200")
"Michael S. Tsirkin" <mst@mellanox.co.il> writes:
> 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.
next prev parent reply other threads:[~2007-01-16 20:15 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-16 15:02 [PATCH RFC] new config option remote.<name>.pushexec Uwe Kleine-König
2007-01-16 15:16 ` Johannes Schindelin
2007-01-16 16:26 ` Uwe Kleine-König
2007-01-16 17:37 ` How to merge FETCH_HEAD? Michael S. Tsirkin
2007-01-16 19:59 ` Shawn O. Pearce
2007-01-16 21:33 ` Michael S. Tsirkin
2007-01-16 21:36 ` Johannes Schindelin
2007-01-17 5:09 ` Michael S. Tsirkin
2007-01-17 6:14 ` Junio C Hamano
2007-01-17 6:33 ` Michael S. Tsirkin
2007-01-16 20:15 ` Junio C Hamano [this message]
2007-01-16 20:08 ` [PATCH RFC] new config option remote.<name>.pushexec Shawn O. Pearce
2007-01-16 20:30 ` Johannes Schindelin
2007-01-17 16:44 ` Uwe Kleine-König
2007-01-17 17:32 ` Junio C Hamano
2007-01-18 7:17 ` Uwe Kleine-König
2007-01-25 4:45 ` [PATCH] make --upload-pack option to git-fetch configurable Uwe Kleine-König
2007-01-25 4:53 ` Uwe Kleine-König
2007-01-16 16:27 ` [PATCH RFC] new config option remote.<name>.pushexec Brian Gernhardt
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=7vfyaaybhm.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=mst@mellanox.co.il \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.