zl程序教程

您现在的位置是:首页 >  其他

当前栏目

Git - 忽略Xcode工程中UserInterfaceState.xcuserstate文件的问题

文件xcodeGit 工程 忽略 问题
2023-09-11 14:21:34 时间

 

一、在同 .Git目录下创建.gitignore文件。在文件中加入如下内容:

*.xcuserstate  

project.xcworkspace  

xcuserdata  

UserInterfaceState.xcuserstate  

project.xcworkspace/  

xcuserdata/  

UserInterface.xcuserstate  

 

二、退出xcdoe, 打开终端(Terminal),进入项目目录下。

三、在终端键入  

git rm --cached [YourProjectName].xcodeproj/project.xcworkspace/xcuserdata/[ YourUsername].xcuserdatad/UserInterfaceState.xcuserstate

 

四、在终端键入  

git commit -m "Removed file that shouldn't be tracked"

 

五、重新打开Xcode 

git commit
git push