1、新建
1.1 此文件的位置跟.git在同一路徑
touch .gitignore
1.2 編輯忽略文件
vim .gitignore
//# 粘貼以下內(nèi)容
*.xcuserstate
project.xcworkspace
xcuserdata
UserInterfaceState.xcuserstate
project.xcworkspace/
xcuserdata/
UserInterface.xcuserstate
//# 保存退出
1.3 添加到緩沖區(qū)
git add .gitignore
1.4 提交
git commit -m "add .gitignore file"
1.5 推送
git push
2敢课、使用忽略文件
2.1 刪除緩存文件
git rm --cached
工程名稱.xcodeproj/project.xcworkspace/xcuserdata/用戶名稱.xcuserdatad/UserInterfaceState.xcuserstate
2.2 提交
git commit -m 'remove some no woring file'
2.3 推送
git push