Git isn’t supported within XCode. In order to get git to work smoothly with XCode, you will need to make sure you instruct git on how to treat the project files properly.
You will need to create a file entitled .gitignore in your repository’s root folder and add the following lines:
# os x cruft .DS_Store # xcode cruft build/* *.pbxuser *.modelv3
Next, create a file named .gitattributes in the repository’s root folder. This file will tell git how to handle individual files. Add the following line to that file:
*.pbxproj -merge -crlf -diff
The “-crlf” flag tells git not to try to fix newlines. The “-merge” flag tells git to exclude it from merges. The “-diff” flag tells git to exclude the file from diffs.
Now add and commit the files to your repository.