Re: Guided merge with override
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Jun 16, 2008, 10:16 UTC
- Message-ID
- <48563D6C.8060704@viscovery.net>
- In-Reply-To
- <20080616092554.GB29404@genesis.frugalware.org>
Miklos Vajna schrieb:
Show 13 quoted lines
> 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