iOS知识总结iOS 的那些事儿

git中忽略UserInterfaceState.xcusers

2017-06-19  本文已影响136人  KSFZHS

1.UserInterfaceState.xcuserstate是什么?

该文件为xcode默认自带文件,是xcode的配置信息,git会用这个文件记录下来。
比如:手动删除此文件,退出xcode后重启xcode,此文件会自动创建并跟踪

  结论:此文件无需push,应忽略

2.使用.gitignore忽略无效,如何解决?

终端输入以下指令:

  git rm --cached 此处填写你的工程名称.xcodeproj/project.xcworkspace/xcuserdata/此处填写你的用户名称.xcuserdatad/UserInterfaceState.xcuserstate
  git commit -m "Removed file that shouldn't be tracked"    
  git push

注意:
执行以上三条指令有以下两个前提

配置完.gitignore文件后,注意下面一个前提

满足以上两个前提后,执行以上三条指令即可

参考资料及链接:

This helped me: 1) quit xcode; 2) go to the project directory and do an "ls -la" from the terminal app to make sure you see the .git and .gitignore files; 3) change "ProjectFolder" in the example above to the name of your project; 4) do the two git commands that matt shows; 5) Relaunch XCode and do a commit and verify that the xcuserstate file is no longer listed.
https://stackoverflow.com/questions/6564257/cant-ignore-userinterfacestate-xcuserstate
http://www.jianshu.com/p/6f464f555f2d

上一篇下一篇

猜你喜欢

热点阅读