threads / discuss / 26073

When I merge, a binary file conflict,how can I select between 2 versions?

Subject: When I merge, a binary file conflict,how can I select between 2 versions?

## tl;dr

3 messages between Dec 15, 2010 and Dec 15, 2010.

replies: 2people: 2as markdown or json

Chunlin Zhang· Dec 15, 2010, 08:00 UTC · lore

The only way now I know is to replace the file with the version file I want in working copy,and then git add and git commit.I think it is inconvenient.

When I use "git mergetool",it output: ''' Merging the files: binary_example.png

Normal merge conflict for 'binary_example.png':
  {local}: modified
  {remote}: modified
Hit return to start merge resolution tool (meld): 
'''

Then I think if there is some command to select local or remote version file to add more easier,because it is obviously git keep 2 version file.

Does anyone know it?
Thanks!
Ilari Liusvaara· Dec 15, 2010, 08:33 UTC · re: Chunlin Zhang · lore

Re: When I merge, a binary file conflict,how can I select between 2 versions?

On Wed, Dec 15, 2010 at 08:00:08AM +0000, Chunlin Zhang wrote:
Show 5 quoted lines
> The only way now I know is to replace the file with the version file I want in
> working copy,and then git add and git commit.I think it is inconvenient.
> 
> Then I think if there is some command to select local or remote version file to
> add more easier,because it is obviously git keep 2 version file.
 
IIRC,

git checkout --theirs -- <file> git add <file>

-Ilari
Chunlin Zhang· Dec 15, 2010, 09:01 UTC · re: Ilari Liusvaara · lore

Re: When I merge, a binary file conflict,how can I select between 2 versions?

Ilari Liusvaara <ilari.liusvaara <at> elisanet.fi> writes:
> git checkout --theirs -- <file>
> git add <file>
Thanks you very much.That is what I want!

← back to recent threads