一、在同 .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
四、在終端鍵入
git commit -m "Removed file that shouldn't be tracked"
五、重新打開Xcode
git commit
git push