让 Xcode 4 服从 .gitignore
我已经成功克隆了 git hub 存储库。该存储库的文件夹结构如下:
root-repository-folder->iOS
因此,我已将 Xcode 4 项目文件夹移动到上述文件夹中,因此文件夹结构如下所示: root-repository-folder->iOS iOS->project
到目前为止一切顺利,但现在当我想再次提交并推送 Xcode 时4 告诉我,我有关于 xcuserdata 的未提交的更改。所以我在项目目录中添加了一个 .gitignore 文件来忽略 xcuserdata。但 Xcode 4 似乎不遵守 .gitignore 文件。所以我被困在这里,我做错了什么?
干杯,
彼得
I've cloned a git hub repository successfully. The folder structure of that repository is as following:
root-repository-folder->iOS
So I've moved my Xcode 4 project folder into the above folder so the folder structure looks like this then: root-repository-folder->iOS->project
I've successfully managed to commit and push my project folder to the Git Hub repository from Xcode 4 by following the guide at http://www.mindthe.net/devices/2011/04/28/12-steps-to-using-github-with-xcode-4/
So far so good, but now when I want to make another commit and push Xcode 4 tells me that I have uncommited changes referring to xcuserdata. So I add a .gitignore file to the project directory to ignore xcuserdata. But Xcode 4 doesn't seem to obey the .gitignore file. So I'm stuck here, what am I doing wrong?
Cheers,
Peter
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想请你参考这里: Git 忽略 Xcode 项目的文件
似乎适合那些使用 Xcode4 的人。确保 .gitignore 中有正确的条目。从命令行验证一次以查看文件是否确实被忽略。
此外,任何已提交的文件都不能被忽略。因此,如果您已经提交了它,
rm
它然后忽略应该可以。I would ask you to refer here: Git ignore file for Xcode projects
Seems to work for those using Xcode4. Make sure you have the correct entries in the .gitignore. Verify from command line once to see if the files are actually being ignored.
Also, any file that is already committed cannot be ignored. So if you had already committed it,
rm
it and then ignore should work.