2

I'm using Mapbox-ios-sdk and try to merge difference from the source in Github to my local hack.

Now I'm trying to tell Git to treat pbxproj file as text by writing

*.pbxproj text -crlf -diff -merge union

to a new file ./git/info/attributes

On git diff MapView/MapView.xcodeproj/project.pbxproj it still treats it as binary:

diff --git a/MapView/MapView.xcodeproj/project.pbxproj b/MapView/MapView.xcodeproj/project.pbxproj
index d91c5b9..d8d04df 100755
Binary files a/MapView/MapView.xcodeproj/project.pbxproj and b/MapView/MapView.xcodeproj/project.pbxproj differ

I've also tried to write it as .gitattributes but it still treat the file as binary. Why is that?

huggie
  • 17,587
  • 27
  • 82
  • 139

1 Answers1

1

From the man gitattributes man page, -crlf and -diff seem to be associated with a way to make a file as binary.

So this should be closer to the mark (a bit like in this config):

*.pbxproj text -merge union
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I am not sure if the merging is proper though. Somehow I'm still not incorporating the new files into the project file added from the remote repository. – huggie Oct 16 '12 at 11:06
  • @huggie does a diff between the local `pbxproj` and the remote ones clearly shows those extra files? – VonC Oct 16 '12 at 11:10
  • 1
    @huggie note: if there are conflicts, a simple script can help resolve them: https://gist.github.com/1790379 – VonC Oct 16 '12 at 11:12
  • I don't know. I've gone ahead and just override my project file with the new one, since I didn't think I added any new files. Now it compiles just fine, though when I run my project image resources from the project is not found and it terminate on runtime. I posted another question for this issue. http://stackoverflow.com/questions/12913447/xcode-incorporating-a-project-but-resource-cannot-be-found – huggie Oct 16 '12 at 11:16
  • 1
    @huggie "just override my project file with the new one": Then a custom merge directive "`keepTheir`" would help here: http://stackoverflow.com/a/1910479/6309 – VonC Oct 16 '12 at 11:20