xcode git 忽略user interface state文件

来源:互联网 发布:淘宝图片多大打开的快 编辑:程序博客网 时间:2024/05/17 05:15

原文链接:http://blog.csdn.net/u014220518/article/details/50480329
1.退出Xcode,进入到你项目的根目录下面;

2.右键查看 项目名称.xcodeproj的包内容,然后显示project.xcworkspace的包内容,打开xcuserdata,打开你的 电脑名称.xcuserdatad,获取UserInterfaceState.xcuserstate的路径;
例如:/Users/zfj_apple/Desktop/CosFundLife/CosFundLife/CosFundLife.xcodeproj/project.xcworkspace/xcuserdata/zfj_apple.xcuserdatad/UserInterfaceState.xcuserstate

3.在总段继续输入命令:
git rm –cached 后面是UserInterfaceState.xcuserstate的路径相对路径(不是绝对路径)
例如:git rm –cachedCosFundLife.xcodeproj/project.xcworkspace/xcuserdata/zfj_apple.xcuserdatad/UserInterfaceState.xcuserstate
4.在终端输入命令 git commit -m “Removed file that shouldn’t be tracked”
5.在终端输入命令 touch .gitignore
6.在终端输入命令 vi .gitignore 进入编辑界面
7.按下i进入可编辑状态,粘贴下面几行:
*.xcuserstate
project.xcworkspace
xcuserdata
UserInterfaceState.xcuserstate
project.xcworkspace/
xcuserdata/
UserInterface.xcuserstate

8.按下esc,接着按shift+:,输入wq,回车;
9.重新打开工程就好了;

原创粉丝点击