美文网首页iOS
如何正确设置.gitignore?

如何正确设置.gitignore?

作者: starfox寒流 | 来源:发表于2015-08-21 15:26 被阅读4488次

如果朋友们有什么更好的方法,请在下面留言。
touch .gitignore vi .gitignore
写入下面内容:
XXX.xcodeproj/project.xcworkspace/xcshareddata XXX.xcodeproj/project.xcworkspace/xcuserdata XXX.xcodeproj/xcuserdata
但是怎么都去不掉这个userInterface.xcuserstate,只好百度了,

今天在Xcode中Commit的时候UserInterfaceState.xcuserstate这个文件几秒钟更新一次, 搅得人不得安宁, 用.gitignore无效. 于是, 在终端中输入:

$ git rm --cached XXX.xcodeproj/project.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate $ git commit -m "Removed the stupid strange file that shouldn't be tracked" $ git push
搞定!

相关文章

网友评论

  • Bonew01:请问如何创建 .gitignore文件?
    Bonew01:@starfox寒流 vim创建后貌似不管用,后来直接换coding.net,
    starfox寒流:vi呀。。。。

    或者如果你是在github上创建的repo,可以选择添加这个文件。。。
  • 3979206bb699:先把文件删了 提交一次,然后把文件恢复回来 就没问题了

本文标题:如何正确设置.gitignore?

本文链接:https://www.haomeiwen.com/subject/hapgqttx.html