Git ignore UserInterfaceState.xcuserstate

时间:2022-06-06 19:41:07

1. 退出xcdoe, 打开终端(Terminal),进入到你的项目目录下

2. 在终端键入  git rm --cached [YourProjectName].xcodeproj/project.xcworkspace/xcuserdata/[YourUsername].xcuserdatad/UserInterfaceState.xcuserstate
3. 在终端键入  git commit -m "Removed file that shouldn't be tracked"

4. 在.gitignore文件中加入如下几行

  1. *.xcuserstate
  2. project.xcworkspace
  3. xcuserdata
  4. UserInterfaceState.xcuserstate
  5. project.xcworkspace/
  6. xcuserdata/
  7. UserInterface.xcuserstate

5. 重新打开Xcode commit, push。