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.
            Asked
            
        
        
            Active
            
        
            Viewed 1.3k times
        
    5 Answers
18
            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
 
    
    
        Pfitz
        
- 7,336
- 4
- 38
- 51
- 
                    
- 
                    @david since I do not use schemes other than the standard one and I am a sole developer this is not relevant for me - if you care about schemes just remove the xcuserdata line above. – Pfitz Jul 25 '12 at 08:34
- 
                    Even though this is old I thought i should chime in on @Pfitz last statement. Even though you are a sole developer for a project, schemas are still important. Especially if you have different environments when connecting to a url. You can easily create a macro for each and every scheme like DEV, PROD and all you have to do is switch the schema to point to that server. Otherwise your going to have to manually change the url for dev and prod which is prone to user error – Esko918 Jul 02 '14 at 15:09
11
            
            
        This is what we use:
#xcode Noise
build/*
*.pbxuser
*.mode2v3
*.mode1v3
*.xcworkspace
xcuserdata
# OSX Noise
.DS_Store
profile
*~
*.lock
*.DS_Store
*.swp
*.out
 
    
    
        Cliff Ribaudo
        
- 8,932
- 2
- 55
- 78
5
            
            
        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.
 
    
    
        Brian
        
- 30,156
- 15
- 86
- 87
- 
                    1You should not ignore Podfile.lock. That is used to ensure that everyone on a particular commit is looking at the same set of Pod files. http://guides.cocoapods.org/using/using-cocoapods.html under "What is a Podfile.lock" – Ying Feb 25 '14 at 13:33
2
            
            
        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
 
    
    
        gregoltsov
        
- 2,269
- 1
- 22
- 37
0
            
            
        I normally ignore the following
- /ProjectPath/project.xcodeproj/xcuserdata
- /ProjectPath/project.xcodeproj/project.xcworkspace
And some hidden files like
- /ProjectPath/.DS_Store
 
    
    
        Omar Abdelhafith
        
- 21,163
- 5
- 52
- 56
 
    