[git] .gitignore for XCode

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.
Advertisements
This entry was posted in git. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s