我使用Git进行Xcode 4项目版本控制。我明确地添加了ProjectFolder.xcodeproj/project.xcworkspace/xcuserdata/myUserName.xcuserdatad/UserInterfaceState。xcuserstate到.gitignore,但是Git不会忽略它。有人知道为什么吗?


当前回答

我觉得这样写比较好。

git rm——cache *//UserInterfaceState.xcuserstate**

其他回答

如果你使用GitHub,这里有一些演示和快捷方式,基本思想是一样的。

1. 像这样打开终端

2. 将下面的命令粘贴到终端,后面加一个空格,然后像这样粘贴.xcuserstate文件的路径

Git rm——缓存

3.确保你有正确的git忽略,然后提交代码:)

只是 "git clean -f -d" 为我工作!

对我来说什么都没用,除了这个

把这条线加到你的gitignore里

*.xcuserdata

我觉得这样写比较好。

git rm——cache *//UserInterfaceState.xcuserstate**

这对我很有用

打开包含项目文件project的文件夹。Xcworkspace。 这样写:git rm——cached *xcuserstate

这将删除文件。