Git ignore file for Xcode 4 projects

By | January 4, 2018
Questions:

Which files are better to ignore in git for an Xcode 4(.3.2)? This older question addresses the same issue but I find my structure to be different so I assume it’s about an older version of Xcode.

Answers:

Here are git ignore files for basicly every language including Xcode : Github – git ignore

For me it is working like a charm. Here is the content of the Objective-C.gitignore

# Xcode
build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
*.xcworkspace
!default.xcworkspace
xcuserdata
profile
*.moved-aside
DerivedData

Questions:
Answers:

This is what we use:

#xcode Noise
build/*
*.pbxuser
*.mode2v3
*.mode1v3
*.xcworkspace
xcuserdata

# OSX Noise
.DS_Store
profile
*~
*.lock
*.DS_Store
*.swp
*.out

Questions:
Answers:

Existing answers are good. I just want to leave a note for people who are using CocoaPods to manage libraries. Besides the xcworkspace generated by CocoaPods, you should also ignore Pods/ directory:

Pods/*

every developer should do pod install on their own machine separately. otherwise, they may face many environment issues.

Questions:
Answers:

I’ve been using the solution from the question you linked with a few changes. I think it has a really nice solution for ignoring unnecessary project files

#OS junk files
[Tt]humbs.db
*.DS_Store
*.bak*

#Xcode files
#This ignores everything inside a *.xcodeproj except the project.pbxproj
*.xcodeproj/
!*.xcodeproj/project.pbxproj
*.log
xcuserdata

#Project files
[Bb]uild/

#Version control files
.svn
*.orig

Questions:
Answers:

I normally ignore the following

  • /ProjectPath/project.xcodeproj/xcuserdata
  • /ProjectPath/project.xcodeproj/project.xcworkspace

And some hidden files like

  • /ProjectPath/.DS_Store

Leave a Reply

Your email address will not be published. Required fields are marked *