Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

project.pbxproj is always tagged as modified in git

I'm having some problems with xcode, with disappearing linked libraries, etc.

After some research, it seems that my project.pbxproj file has been completely changed in between two commits, and I'm trying to restore an older version. However, and it has been some time now, my project.pbxproj is always flagged by git as modified. I've always figured it was XCode modifying the file at the same time I was modifying some things in the GUI. However, for the first time, git is keeping me from merging, or reverting, due to changes to this file. I can't gitignore it as it contains vital information necessary to build my project.

It gets weirder, though, as the file is indeed always in a modified state. I just tried booting my mac with absolutely no app open, no IDE, not xcode, and just opening a terminal, to clone my project in a newly created folder. After cloning, if I just cd into the folder and git status, the file is flagged as modified.

Is this behavior normal? Have people experienced issues with this file and git? Can i revert my project.pbxproj to an older state, and is it safe to do so? Are there some git configurations that I can use to better handle this file?

My project isn't native, I'm using the react-native framework

like image 389
PoutchiPatch Avatar asked Nov 30 '25 22:11

PoutchiPatch


1 Answers

The file project.pbxproj is constantly changing since it contains information about the structure and configuration of the project, linked frameworks and more.

i found that adding *.pbxproj binary merge=union in my .gitattributes fixed 95% of my merge problems in that file, there is always one rare case where the union fails and you end up with bad closing brackets, but is usually easy to find and fix it manually.

like image 74
javier rivarola Avatar answered Dec 02 '25 12:12

javier rivarola



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!