步骤:
打开终端窗口:
1 .$ cd xxxxx //拖动文件到终端窗口,切换到在工程目录下
2 .$ touch .gitignore //在目录下生成.gitignore 文件
3 .$ open .gitignore //打开.gitignore 文件,通过文本编辑器方式,或者vim编辑
4 . 写入忽略目录:把下面信息copy到gitignore 然后保存
.gitignore 文件:
#CocoaPods
Pods/
# 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
5 .$ git rm -r --cached Pods/ //删除云端已经存在的Pods忽略文件,保留本地文件
其他命令:
git rm file_path //删除云端和本地
git rm --cached file_path //只删除云端
当你需要向向你的项目中安装新的pod库时使用pod install。
只有当你想要更新pod库的版本时才使用pod update。