转自:http://blog.csdn.net/lovenjoe/article/details/50053255
解决了我的问题,借过来记一下。
一、在同 .git目录下创建.gitignore文件。在文件中加入如下内容:
*.xcuserstate
project.xcworkspace
xcuserdata
UserInterfaceState.xcuserstate
project.xcworkspace/
xcuserdata/
UserInterface.xcuserstate
二、退出xcdoe, 打开终端(Terminal),进入项目目录下。
三、在终端键入
git rm --cached [YourProjectName].xcodeproj/project.xcworkspace/xcuserdata/[ YourUsername].xcuserdatad/UserInterfaceState.xcuserstate
其中 [YourProjectName].xcodeproj/project.xcworkspace/xcuserdata/[ YourUsername].xcuserdatad/UserInterfaceState.xcuserstate 可以在git status里看到,复制过来
四、在终端键入
git commit -m "Removed file that shouldn't be tracked"
五、重新打开Xcode commit, push。