不能忽略UserInterfaceState.xcuserstate [英] Can't ignore UserInterfaceState.xcuserstate

查看:186
本文介绍了不能忽略UserInterfaceState.xcuserstate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Git进行Xcode 4项目版本控制.我已将ProjectFolder.xcodeproj/project.xcworkspace/xcuserdata/myUserName.xcuserdatad/UserInterfaceState.xcuserstate显式添加到.gitignore中,但是Git不会忽略它.任何想法为什么会这样吗?

I'm using Git for Xcode 4 project version control. I've explicitly added ProjectFolder.xcodeproj/project.xcworkspace/xcuserdata/myUserName.xcuserdatad/UserInterfaceState.xcuserstate to .gitignore, but Git it won't ignore it. Any ideas why this is so?

推荐答案

Git可能已经在跟踪文件了.

Git is probably already tracking the file.

gitignore文档:

要停止跟踪当前跟踪的文件,请使用 git rm --cached .

使用此信息,将[project][username]替换为您的信息:

Use this, replacing [project] and [username] with your info:

git rm --cached [project].xcodeproj/project.xcworkspace/xcuserdata/[username].xcuserdatad/UserInterfaceState.xcuserstate
git commit -m "Removed file that shouldn't be tracked"

或者,您可以使用-a选项来 git commit ,将添加所有已修改或删除的文件.

Alternatively you can use the -a option to git commit that will add all files that have been modified or deleted.

一旦您从git中删除了文件,它将尊重您的.gitignore.

Once you've removed the file from git, it will respect your .gitignore.

这篇关于不能忽略UserInterfaceState.xcuserstate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆