3

I am merging a feature branch into the master branch and I want to overwrite some of the files in the master branch. The files I want to overwrite generally contain text configurations and some binary data encoded as text so they are bound to be problematic and I don't care about those anyway. They are intended to replace those in the master.

Auto-merging frmShopSupportIncidents.lfm
CONFLICT (content): Merge conflict in frmShopSupportIncidents.lfm
Auto-merging frmNewShop.lfm
CONFLICT (content): Merge conflict in frmNewShop.lfm
Auto-merging frmCliCustsBrowser.lfm
CONFLICT (content): Merge conflict in frmCliCustsBrowser.lfm
Auto-merging custManager.lpi
Auto-merging clientShopFrame01.lfm
CONFLICT (content): Merge conflict in clientShopFrame01.lfm
Automatic merge failed; fix conflicts and then commit the result.

How do I get the conflicts to be ignored and overwritten any way?

hjpotter92
  • 78,589
  • 36
  • 144
  • 183
vfclists
  • 19,193
  • 21
  • 73
  • 92

2 Answers2

6

You can use:

git checkout --theirs .

To accept all the upstream changes.

Or if you know that only for some files you would like to use the upstream version apply the checkout only for these files, for the rest of them you can resolve the conflicts manually. Eg.

git checkout --theirs frmNewShop.lfm frmCliCustsBrowser.lfm  
dan
  • 13,132
  • 3
  • 38
  • 49
1

I would say that configuration files do not belong being committed in GIT to start with.

However, to keep "your" changes you can follow: https://medium.com/@porteneuve/how-to-make-git-preserve-specific-files-while-merging-18c92343826b#.r3hadlpt5

tkarls
  • 3,171
  • 3
  • 27
  • 27
  • I don't agree with: "do not belong being committed in GIT", can you elaborate? I think that when you are dealing with multiple releases/branches it's mandatory. – dan Nov 30 '15 at 12:12
  • Perhaps you have a valid use case. It just sounded like it was "per user" configuration files. – tkarls Nov 30 '15 at 16:56