- 1、开启终端,CD进入到工程目录下,使用 touch .gitignore
- 2、新建.gitignore文件,然后使用 open .gitignore 打开.gitignore文件
- 3、把下面的代码粘贴到.gitignore文件中,保存就可以了。
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
# Mac OS X Finder and whatnot
.DS_Store
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
## Other
*.moved-aside
*.xcuserstate
*.xccheckout
## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM
#CocoaPods
Pods/