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

Re: Merging a branch when I don't want conflicts

From
Nanako Shiraishi <nanako3@lavabit.com>
Date
May 18, 2009, 10:45 UTC
Message-ID
<20090518194548.6117@nanako3.lavabit.com>
In-Reply-To
<4A10FDC6.2040706@viscovery.net>
Quoting Johannes Sixt <j.sixt@viscovery.net>:
Show 17 quoted lines
> Geoff Russell schrieb:
>> How do I merge a branch X into my master and tell git that whenever there
>> is a conflict, the file on X should prevail?  This is for a scripted
>> application.
>
> I assume you talk about file-level (content) merges.
>
> There is no such tool, and the reason is that what you try to do here does
> not make sense *in general*. It must be a very special kind of project
> where you can blindly trust one side over the other if there are
> conflicts, and that you can additionally trust non-conflicting content merges.
>
> The best you can do is perhaps to pipe conflicting files through
>
>     sed -e '/^<<<<<<</,/^=======/d' -e '/^>>>>>>>/d'
>
> -- Hannes
I think -Xours enhancement that was developed long time ago
    http://thread.gmane.org/gmane.comp.version-control.git/76650/focus=89021
should help Geoff's use case.
-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
Previous: Geoff RussellNext: Tay Ray Chuan
Message 6 of 8 in “Merging a branch when I don't want conflicts”
  1. Geoff RussellMay 18, 2009
  2. Johannes SixtMay 18, 2009
  3. Geoff RussellMay 18, 2009
  4. Johannes SixtMay 18, 2009
  5. Geoff RussellMay 18, 2009
  6. Nanako ShiraishiMay 18, 2009
  7. Tay Ray ChuanMay 18, 2009
  8. Junio C HamanoMay 18, 2009

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.