Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gitignore template for Xcode, IntelliJ Idea and Phonegap (aka Cordova)

Tags:

git

xcode

cordova

Does anyone have a good pre-rolled gitignore file for iPhone development using Xcode and PhoneGap?

Currently I'm using:

.idea
.DS_Store
*.swp
*~.nib

build/
adhoc/

.xcodeproj/ !*.xcodeproj/project.pbxproj

*.mode1v3
*.mode2v3

build/

xcuserdata

But I'm not sure this is ideal. For example, updating Phonegap kinda messes up a lot of things. Also, if another developer just builds the project using Xcode, then git will pick up some changes.

Oddly enough, Xcode does not feature on this list: https://github.com/github/gitignore

like image 440
Jack Avatar asked May 22 '12 07:05

Jack


2 Answers

I ended up with this .gitignore config, which worked fine:

.idea
.DS_Store
*.swp
*~.nib

build/
adhoc/

.xcodeproj/ !*.xcodeproj/project.pbxproj

*.mode1v3
*.mode2v3

build/

xcuserdata
like image 147
Jack Avatar answered Sep 20 '22 02:09

Jack


Here's an updated version of a sample .gitignore for Xcode iOS and OSX projects I made several years ago, which excludes a variety of things from the archive which are not necessary to archive, and which you might not encounter often or notice when they slip through. It's intended to be reasonably comprehensive. It includes temp files from various editors and user preference files from Xcode and its ancestors. (You might not encounter these often, but they show up now and then, in projects with deeper roots, or if you work with a new team member who likes a different editor.)

Sample .gitignore for Xcode iOS and OSX projects

# Mac OS X Finder and whatnot 
.DS_Store
.Trashes

# Sparkle distribution Private Key
dsa_priv.pem

# Xcode (and ancestors) per-user config 
*.mode1
*.mode1v3
*.mode2v3
*.perspective
*.perspectivev3
*.pbxuser

#  Whitelist the Xcode defaults
!default.mode1
!default.mode1v3
!default.mode2v3
!default.perspective
!default.perspectivev3
!default.pbxuser

# Xcode 4 - Deprecated classes
*.moved-aside

# Xcode gcc 
*.hmap

#JetBrains AppCode
.idea/

# Generated files
VersionX-revision.h

# build products 
xcuserdata/
DerivedData/
build/
adhoc/
*.[oa]

# CocoaPods
Pods/

# Other source repository archive directories 
.hg
.svn
CVS

# automatic backup files
*~.nib
*.swp
*.lock
*~
*(Autosaved).rtfd/
Backup[ ]of[ ]*.pages/
Backup[ ]of[ ]*.key/
Backup[ ]of[ ]*.numbers/
                                                                                                                                                                                    
like image 34
Gary W. Longsine Avatar answered Sep 23 '22 02:09

Gary W. Longsine