不能忽略UserInterfaceState.xcuserstate [英] Can't ignore 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屋!