創(chuàng)建 .gitignore
cd worksapce 到工程根目錄下
touch .gitignore 創(chuàng)建忽略文件
vim .gitignore vim編輯文件
在 .gitignore中添加需要忽略的文件
*.xcuserstate
project.xcworkspace
xcuserdata
UserInterfaceState.xcuserstate
project.xcworkspace/
xcuserdata/
UserInterface.xcuserstate
最后刪除緩存
git rm --cached 需要刪除的文件路徑
如:
git rm --cached ProjectFolder.xcodeproj/project.xcworkspace/xcuserdata/myUserName.xcuserdatad/UserInterfaceState.xcuserstate