Git ignore file for Xcode projects


Which files should I include in .gitignore when using Git in conjunction with Xcode?

This question is tagged with xcode git macos version-control gitignore

~ Asked on 2008-09-08 11:07:49

5 Answers


Based on this guide for Mercurial my .gitignore includes:




I've also chosen to include:


which, according to this Apple mailing list post, are "user-specific project settings".

And for Xcode 4:


~ Answered on 2008-09-08 11:14:32


You should checkout for Objective-C and Swift.

Here is the .gitignore file I'm using:

# Xcode


~ Answered on 2014-09-25 09:14:02


Mine is a .bzrignore, but it is the same idea :)


The tm_build_errors is for when I use TextMate to build my project. It is not quite as comprehensive as Hagelin, but I thought it was worth posting for the tm_build_errors line.

~ Answered on 2008-09-08 17:51:38


Here's the .gitignore that GitHub uses by default for new Xcode repositories:

It's likely to be reasonably correct at any given time.

~ Answered on 2014-10-28 17:45:25


We did find that even if you add the .gitignore and the .gitattribte the *.pbxproj file can get corrupted. So we have a simple plan.

Every person that codes in office simply discards the changes made to this file. In the commit we simple mention the files that are added into the source. And then push to the server. Our integration manager than pulls and sees the commit details and adds the files into the resources.

Once he updates the remote everyone will always have a working copy. In case something is missing then we inform him to add it in and then pull once again.

This has worked out for us without any issues.

~ Answered on 2013-09-04 08:03:12

Most Viewed Questions: