iOS 设置gitignore

步骤:
打开终端窗口:

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。
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容