多人項(xiàng)目中提交代碼時(shí)封孙,很多用戶信息是不需要上傳,可以保證代碼提交最整潔匿垄。
git中有一個(gè)非常牛的文件(.gitignore)移宅,有了這個(gè)文件,每次本地倉儲(chǔ)發(fā)生變更時(shí)椿疗,在這個(gè)文件內(nèi)目錄或者文件漏峰,即使內(nèi)容變化也不會(huì)被監(jiān)控,保證開發(fā)在git add時(shí)届榄,不添加這些變更浅乔。
那么,iOS開發(fā)中的.gitignore文件如何撰寫內(nèi)容呢铝条?這里有個(gè)比較通用的答案:
https://github.com/github/gitignore/blob/master/Objective-C.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
*.moved-aside
*.xcuserstate
## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://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
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
fastlane/report.xml
fastlane/screenshots
# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode
iOSInjectionProject/