开发使用CocoaPods 开发项目,很容易提交一些不需要的代码到仓库,在SourceTree 里添加忽略文件这块老弄错,这次专门博客一下忽略步骤如下:
在SourceTree的偏好 编辑里面添加
*~
.DS_Store
*.xcuserstate
*.xcworkspace
xcuserdata
*.lock
Pods
如果添加了gitignore还是不起作用,则需要把缓存清除一下
git rm -r --cached .
git add .
git commit -a -m "清除缓存,gitignore起作用"
git push
还有就是.xcuserstate提交问题

本文介绍如何在使用CocoaPods的项目中正确设置.gitignore文件来排除不必要的文件,确保源代码仓库的整洁,并解决.xcuserstate等文件被误提交的问题。
1632

被折叠的 条评论
为什么被折叠?



