Git 1.6.6 and Xcode 3.2.x

July 12th, 2010

I like to use git as my primary source code version control. Git commands are simple to use and git’s method of branching, commits, tags are easy to understand and use. However, Xcode supports only svn within the IDE. Git can still be used with Xcode but a .gitignore file and .gitattributes file should be created.

The .gitignore File

In Xcode 3.2.x the *.xcodeproj folder contains project files specific to Xcode. I usually specify to git that the xcodeproj folder should be ignored, except for the pbxproj file within the folder.

#
# .gitignore file
#
# Ignore any build files and older project files
build/*
*.mode1v3
*.mode2v3
*.pbxuser
*.perspective
*.perspectivev3

# Don't ignore the pbxproj within the xcodeproj folder
!*.xcodeproj/project.pbxproj

# Ignore .svn information
.svn

# Ignore OSX-specific files
.DS_Store
profile

The .gitattributes File

I usually specify to git that it should not convert, diff, or merge the *.pbxproj file.

#
#
# .gitattributes file
#
# Effectively treat the pbxproj as binary
#
*.pbxproj -crlf -diff -merge

Links

For more info about gitignore

For more info about gitattributes

Sorry, comments are closed for this article.