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

Binary file-friendly merge -Xours or -Xtheirs?

From
SBStephen Bash <bash@genarts.com>
Date
Sep 7, 2012, 14:48 UTC
Message-ID
<1265473388.275309.1347029328407.JavaMail.root@genarts.com>
In-Reply-To
<1799969825.275125.1347028392272.JavaMail.root@genarts.com>
Hi all-
Helping a coworker resolve merge conflicts today I found I wanted a -Xtheirs that completely replaces conflicted binary files with the copy from the incoming branch.  In other words rather than doing
  $ git merge maint
  ... conflicts occur ...
  $ git checkout --theirs -- path/to/binary-file
  $ git add path/to/binary-file
  $ git commit
I'd like to do
  $ git merge -Xbinary_theirs maint
  ... binary conflicts are resolved automatically ...
>From reading the docs it's obvious the current -Xours and -Xtheirs expect to work on hunks, so I (mostly) understand the current behavior, but as a user it feels like "I'm telling you how to resolve conflicts, please do the same thing for binary files".
I am missing a solution that already exists?  Or is this perhaps an improvement that could be made?

Thanks, Stephen

Next: Junio C Hamano
Message 1 of 12 in “Binary file-friendly merge -Xours or -Xtheirs?”
  1. Stephen BashSep 7, 2012
  2. Junio C HamanoSep 7, 2012
  3. 0/2 Teaching -Xours/-Xtheirs to binary ll-merge driverJunio C Hamano, Sep 9, 2012
  4. 1/2 merge: teach -Xours/-Xtheirs to binary ll-merge driverJunio C Hamano, Sep 9, 2012
  5. 2/2 attr: "binary" attribute should choose built-in "binary" merge driverJunio C Hamano, Sep 9, 2012
  6. Jeff KingSep 10, 2012
  7. Junio C HamanoSep 12, 2012
  8. Stephen BashSep 12, 2012
  9. Junio C HamanoSep 12, 2012
  10. Stephen BashSep 12, 2012
  11. Jeff KingSep 12, 2012
  12. Stephen BashSep 9, 2012

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.