Xcode 4 projects: Creating a Git ignore file

The option is especially intriguing for disregarded files that have no relevance to the project, including IDE-related files and others. This method is commonly employed to exclude certain file types from a specific folder in a particular repository.

Question:

Regarding ignoring files in git for Xcode 4(.3.2), I came across an older question that discussed this issue. However, as my file structure differs from the one mentioned in that question, I assume it pertains to an earlier version of Xcode.



Solution 1:


Find the
git ignore files
that cover a wide range of languages, such as
Xcode : Github
and
git ignore

The Objective-C.gitignore content is functioning perfectly for me.

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


Solution 2:

This is what we use:

#xcode Noise
build/*
*.pbxuser
*.mode2v3
*.mode1v3
*.xcworkspace
xcuserdata
# OSX Noise
.DS_Store
profile
*~
*.lock
*.DS_Store
*.swp
*.out


Solution 3:

The current responses are sufficient. My intention is to provide a heads-up to those who utilize

CocoaPods

as a library management tool. In addition to the

xcworkspace

produced by CocoaPods, it is important to disregard the

Pods/

directory.

Pods/*

It is recommended that each developer executes

pod install

on their individual machine to avoid encountering various environmental problems.


Solution 4:

With some modifications, I have implemented the solution provided in the linked question. It offers an effective way of disregarding extraneous
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

Frequently Asked Questions

Posted in Ios