git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Miklos Vajna <vmiklos@frugalware.org>
Cc: Geoff Russell <geoffrey.russell@gmail.com>, git@vger.kernel.org
Subject: Re: Guided merge with override
Date: Mon, 16 Jun 2008 12:16:12 +0200	[thread overview]
Message-ID: <48563D6C.8060704@viscovery.net> (raw)
In-Reply-To: <20080616092554.GB29404@genesis.frugalware.org>

Miklos Vajna schrieb:
> On Mon, Jun 16, 2008 at 01:46:38PM +0930, Geoff Russell <geoffrey.russell@gmail.com> wrote:
>> I have a two repositories A and B.  B is a tiny subset of the files in
>> A and all have been
>> modified.   If I do a "git pull B" into A, I get conflicts. I always
>> want to resolve these
>> by accepting the version from B. Is there a magic "override" switch to
>> let me do this?
> 
> There was a thread about this:
> 
> http://thread.gmane.org/gmane.comp.version-control.git/84047
> 
> and then you can do a git pull -s theirs B.

I don't think that's what Geoff needs. The 'theirs' strategy replaces the
entire tree by 'their' - B's - tree. But IIUC, only the subset of files
that are contained in B should be replaced by B's version, the rest of the
files should remain unchanged. This is quite different from 'theirs' strategy.

The solution depends on whether *all* files in B should be taken, or only
those files in B where there's a merge conflict. I don't know an easy way
to do the former, but the latter I'd do like this:

	$ git diff --name-only | xargs git checkout B --

-- Hannes

  reply	other threads:[~2008-06-16 10:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-16  4:16 Guided merge with override Geoff Russell
2008-06-16  9:25 ` Miklos Vajna
2008-06-16 10:16   ` Johannes Sixt [this message]
2008-06-16 21:16     ` Miklos Vajna
2008-06-16 22:21     ` Sverre Rabbelier
2008-06-16 22:45       ` Geoff Russell
2008-06-17 20:04         ` Junio C Hamano
2008-06-18 15:19           ` Johannes Schindelin
2008-06-18 15:28             ` Johannes Schindelin
2008-06-18 16:31               ` Junio C Hamano
2008-06-18 19:29                 ` Johannes Schindelin
2008-06-20  7:38                 ` [PATCH 1/2] git-merge-file --ours, --theirs Junio C Hamano
2008-06-20  7:48                   ` [PATCH 2/2] git-merge-recursive-{ours,theirs} Junio C Hamano
2008-06-20 12:58                     ` Johannes Schindelin
2008-06-21  9:46                       ` Junio C Hamano
2008-06-21 16:29                         ` Johannes Schindelin
2008-06-21 16:56                         ` Jakub Narebski
2008-06-17  6:16       ` Guided merge with override Johannes Sixt
2008-06-17  8:53         ` Sverre Rabbelier
2008-06-17  9:48           ` Johannes Schindelin
2008-06-17  9:53             ` Sverre Rabbelier
2008-06-17 10:17               ` Johannes Schindelin

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=48563D6C.8060704@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=geoffrey.russell@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=vmiklos@frugalware.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;
as well as URLs for NNTP newsgroup(s).