/ iOS

What should contain your .gitignore file in a GIT iOS project

You can wonder what kind of information should be skipped by your .gitignore file when working with iOS projects and GIT as your source control manager. Here is a detailed view of what you could use.

The .gitignore file tells GIT what are the files that shouldn't be considered by the source control manager, the files that should be discarded from versioning.

We don't want some system files

So, we can discard any .ds_store file from the GIT repository.

# OS X Finder
.DS_Store
We don't want the Xcode files you defined as a user

These files are the ones used to maintain the tabs you decided to display on Xcode, and some other equivalent files. So we discard them.

# Xcode per-user config
*.mode1
*.mode1v3
*.mode2v3
*.perspective
*.perspectivev3
*.pbxuser
xcuserdata
We don't want compiled files to be in the repository

All files that could result from a transformation by any compiler used during the compilation of your final product should alse be discarded by GIT.

/build/
build
*.o
*.LinkFileList
*.hmap
profile
*.moved-aside
DerivedData/
*/DerivedData
.idea/
*.orig
Carthage/Checkouts/
The complete final file

Once we concatenate all these parts, we have the following .gitignore file.

# OS X Finder
.DS_Store

# Xcode per-user config
*.mode1
*.mode1v3
*.mode2v3
*.perspective
*.perspectivev3
*.pbxuser
xcuserdata

# Build products
/build/
build
*.o
*.LinkFileList
*.hmap
profile
*.moved-aside
DerivedData/
*/DerivedData
.idea/
*.orig
Carthage/Checkouts/

# Automatic backup files
*~.nib/
*.swp
*~
*.dat
*.dep