cd 到文件夹
先删除ds store文件
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
在文件夹中touch .gitignore
open .gitignore
在文件中加入
# Xcode
.DS_Store
*/.DS_Store
*/build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
*.hmap
*.xccheckout
*.xcworkspace
*.xcuserstate
!default.xcworkspace
#CocoaPods
#Podfile
Podfile.lock
提交至git
git add .gitignore
git commit -m 'delete .DS_Store'