已删除的文件是否仍可通过 hg 克隆下载?
在我们的 Mercurial 存储库中,我们添加了一个非常大的文件(并进行了 hg 推送),然后删除了该大文件(并进行了另一次推送)。
现在,如果有人进行 hg 克隆
,他们还会拉下那个大文件吗?我知道它不会出现在他们的工作目录中,因为它已被删除,但该文件是否仍会被拉下来并存储在 Mercurial 内部存储中?
我想确保人们不必拉下该文件。我了解到真正大的文件应该存储在 Mercurial 之外,所以我删除了该文件。但我想知道人们是否仍然会拉下大文件 - 在这种情况下我想我会从头开始重新创建存储库。
In our Mercurial repo we added a really big file (and did an hg push), then deleted the big file (and did another push).
Now if someone does an hg clone
will they still pull down that big file? I know it won't appear in their working directory as it was deleted, but will the file still be pulled down and stored in Mercurial internal storage?
I'd like to ensure people don't have to pull down the file. I've learned that really big files should be stored outside of Mercurial, so I deleted the file. But I was wondering if people will still be pulling down the big file - in which case I guess I will recreate the repository from scratch.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当然它仍然会在存储库中。
您始终可以更新回较旧的版本,如果您更新回提交文件时获得的版本,它将尽显其荣耀。
有两种方法可以缓解这种情况(当您提交时,而不是现在):
现在,您有四个选择:
hg Convert
命令和一些过滤,可以使用--filemap
选项请注意,手动或通过 hg Convert 重建存储库将使所有克隆失效。任何尝试从旧克隆推送到新中央克隆的人都会收到一条有关
不相关存储库
的消息。如果您的任何用户不够聪明,没有意识到强制推送是一个坏主意,那么您在使用这种方法时就会遇到问题。Of course it will still be in the repository.
You can always update back to older revisions, and if you update back to the revision you got when you committed the file, it'll be there in all its glory.
There are two ways to mitigate this (when you're committing, not now):
Right now, you got four options:
hg convert
command and some filtering, the--filemap
option can be used for thisNote that rebuilding the repository, either manually or through
hg convert
will invalidate all clones. Anyone trying to push to your new central clone from an old clone will get a message aboutunrelated repositories
. If any of your users are stupi^H^H^H^H^Hnot smart enough to realize that forcing the push is a bad idea, then you will have problems with this approach.是的,该文件仍在历史记录中。如果您想完全删除它,则需要使用 Mercurial 队列 - 请参阅 Mercurial wiki 上的编辑历史记录 。
请记住,当修订 ID 发生更改时,这会破坏克隆。
Yes, the file is still in the history. If you want to delete it completely, you need to use Mercurial Queues — see Editing History on Mercurial wiki.
Just keep in mind this breaks clones as revision IDs change.