这个方式用于,删除git已经存在的userinterface,ds_store文件
1先cd到目录中
touch .gitignore
2:在文件中输入下面内容
*.xcuserstate
project.xcworkspace
xcuserdata
UserInterfaceState.xcuserstate
project.xcworkspace/
xcuserdata/
UserInterface.xcuserstate
.DS_Store
*/.DS_Store
3:如果项目中已经存在了ds_store文件
git rm --cached .DS_Store
git commit -m "Remove .DS_Store from repository"
4:如果项目中存在UserInterfaceState文件
//这里用于没有pod的工程路径
git rm --cached [工程名称].xcodeproj/project.xcworkspace/xcuserdata/[用户名].xcuserdatad/UserInterfaceState.xcuserstate
//存在pod工程路径
git rm --cached [工程名称].xcworkspace/xcuserdata/[用户名].xcuserdatad/UserInterfaceState.xcuserstate
git commit -m "Removed UserInterfaceState"
5:提交内容就可以了