1

I have git setup with an xcode project. Inside that project is a .storyboard file which is a very long xml file.

This file causes many conflicts when merging, because when updating the layout all views can get a minor change in their position or size by sometimes only 1px.

I have some branches in my git.

When Im on my master branch and want to merge master with my Test branch i get around 30 conflicts in that particular file.

Because it looks like this when there is a conflict:

>>>>>> HEAD 
           <Some stuff />
======
           <Some stufff />
>>>>>> Test

Is it possible to remove all the conflicts from HEAD or the branch I merged with?

Dau
  • 8,578
  • 4
  • 23
  • 48
Arbitur
  • 38,684
  • 22
  • 91
  • 128

1 Answers1

2

When the conflict arrives there are three files created

  1. File of branch in which you are says ours (master in your case)
  2. File of branch you want to merge says theirs (test in your case)
  3. File with all the conflicts

and you can do the followings

  1. Keep master branch files using git checkout --ours <file path>
  2. Keep test branch files using git checkout --theirs <files path>
  3. Resolve the conflicts manually

You can read more about it

  1. http://gitready.com/advanced/2009/02/25/keep-either-file-in-merge-conflicts.html
  2. http://git-scm.com/docs/git-checkout
  3. Choose Git merge strategy for specific files ("ours", "mine", "theirs")
Community
  • 1
  • 1
Dau
  • 8,578
  • 4
  • 23
  • 48