Amanda Mitchell
Amanda Mitchell

Reputation: 2685

Can git be configured to disable merges for particular file types?

For example, Apple's Interface Builder file format (xib) is, for all practical purposes, impossible to merge. However, because it's a text format, git will happily try to merge files of this type, and this will almost certainly result in corruption if git "succeeds".

Can git be configured to always fail to merge xib files, as it would for binary formats?

Upvotes: 15

Views: 1598

Answers (1)

Chris Mansley
Chris Mansley

Reputation: 782

Yes. There is a great file called .gitattributes, which allows you to set individual properties for files in your git project. For your purposes, you would fill your .gitattributes with this line

*.xib -crlf -diff

This turns off line-feed correction and disables diff on this file. You can read a little more here or here

Upvotes: 11

Related Questions