从 Xcode 的存储库中删除未引用的图像 [英] Delete an unreferenced image from repository in Xcode

查看:43
本文介绍了从 Xcode 的存储库中删除未引用的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从我的资源文件夹中删除了 default.png,因为我想要一个不同的加载屏幕图像,但我只是删除了引用,这显然是一件愚蠢的事情.我将新图像拖到资源中并尝试将名称更改为 Default.png,但它不会让我这样做,我认为这是因为第一个 Default.png 仍在存储库中的某个地方.无论如何,当它在 xcode 中不再可见时,我如何从存储库中删除该图像(以及我可能做过同样事情的其他图像)?

I deleted default.png from my resources folder because I wanted a different image for the loading screen, but I just deleted the reference which was apparently a dumb thing to do. I dragged the new image into resources and tried to change the name to Default.png, but it won't let me, which I think is because the first Default.png is still in the repository somewhere. Anyway, how do I delete that image(and others with which I have probably done the same thing) from the repository when it is no longer visible in xcode?

推荐答案

它是什么样的存储库?颠覆?吉特?

What kind of repository is it? Subversion? Git?

Xcode 中的 SCM 集成非常适合在无需离开 IDE 的情况下检出文件和提交更改,但它对于 svn 或 git 来说都不是一个成熟的 GUI 前端.可以通过将文件添加回项目然后在 Xcode 中删除它来修复您的错误,这样 Xcode 就会为您从存储库中删除它,但简单的解决方案是从存储库中删除该文件自己使用适当的版本控制命令.例如,如果您使用 Subversion,您可以:

The SCM integration in Xcode is great for checking out files and committing changes without having to leave the IDE, but it's hardly a full-blown GUI front end to either svn or git. It may be possible to fix your mistake by adding the file back to the project and then deleting it in Xcode in such a way that Xcode will remove it from the repository for you, but the simple solution is to just delete the file from the repository yourself by using the appropriate version control command. For example, if you're using Subversion you could:

svn remove default.png

从您的存储库版本中删除文件.当您提交更改时,该文件将在该版本中被删除.(它仍然存在于以前的版本中——毕竟,这就是 SCM 的全部意义所在.)

to remove the file from your version of the repository. When you commit your changes, the file will be deleted in that version. (It'll still exist in previous versions -- that's the whole point of SCM, after all.)

之后,您可以创建新文件并以通常的方式将其添加到项目和存储库中.

After that, you can create the new file and add it to both the project and the repository in the usual way.

这篇关于从 Xcode 的存储库中删除未引用的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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