I'm working on an iOS project and am using git to do version control. I'm working on this with another developer.
Which Xcode project files should I keep in the repo and which ones can I exclude so that it doesn't affect the other developer negatively?
Here are some of the non-code files that git is telling me has been modified or added... (BTW, these are only viewable in the OSX file manager if you "Show Package Contents" for YourProject.xcodeproj file)
exclude ?
INCLUDE ?
Does this seem right?
(Just an FYI for those that want to use the exclude feature of git. Edit your .git/info/exclude file in your local repository. Put in the files or the patterns for files that you want git to ignore. For example, if you want git to ignore foo.temp, bar.temp you can put a line in the file that says *.temp)
Fortunately the site gitignore.io has solved this problem for you. Go to gitignore.io, enter Xcode in the search field, and click the Create button. You will get a git ignore file with a list of file types that git should ignore. Add the git ignore file to your project folder.
If you want to ignore a file that you've committed in the past, you'll need to delete the file from your repository and then add a .gitignore rule for it. Using the --cached option with git rm means that the file will be deleted from your repository, but will remain in your working directory as an ignored file.
You shouldn't store credentials like usernames, passwords, API keys and API secrets. If someone else steals your credentials, they can do nasty things with it.
Think this is a great place to start Xcode .gitignore
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
## Other
*.xccheckout
*.moved-aside
*.xcuserstate
This one I modified Xcode .gitignore I believe it to be more comprehensive.
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
## Other
*.xccheckout
*.moved-aside
*.xcuserstate
*.xcscmblueprint
## Obj-C/Swift specific
*.hmap
*.ipa
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the- pods-directory-into-source-control
#
#Pods/
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
The above adds CocoaPods, Carthage and some others that have shown up over time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With