git 配置忽略文件(忽略UserInterfaceState.
2020-08-04 本文已影响0人
三岁就很乖
[git中忽略UserInterfaceState.xcuserstate的方法]
使用版本控制来托管代码时会遇到这样的问题
添加过.gitignore文件后每次push时还是会有UserInterfaceState.xcuserstate文件
这时可以在终端中输入
git rm --cached project.xcworkspace/xcuserdata/myUserName.xcuserdatad/UserInterfaceState.xcuserstate
git commit -m "Removed file that shouldn't be tracked"
或
git rm --cached project.xcodeproj/xcuserdata/myUserName.xcuserdatad/UserInterfaceState.xcuserstate
git commit -m "Removed file that shouldn't be tracked"
Breakpoints_v2.xcbkptlist路径同上处理
ytkjzd.xcworkspace/xcuserdata/qhdjtjy.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
这里要注意的有三点:
1.首先要进入该工程的路径中,也就是.xcodeproj的上一级,否则会出现以下错误
fatal: path spec 'ProjectFolder.xcodeproj/project.xcworkspace/xcuserdata/myUserName.xcuserdatad/UserInterfaceState.xcuserstate' did not match any files
2.project为对应的工程名称
3.myUserName为对应的用户名称(电脑)