清理版本控制中未使用的旧大文件
对于我当前的项目,我使用 Mercurial 并将其托管在 Bitbucket 上。
这是我真正正确使用版本控制的第一个项目,所以一开始我犯了一些错误。其中之一是我将我的项目使用的所有(未压缩)声音文件与代码一起存储在存储库中。
因此,现在即使我不再将这些文件存储在那里,第一次从服务器拉取仍然需要相当长的时间(我猜测存储库保存了所有这些文件,以便我可以恢复这些文件如果我愿意的话?)并且该项目占用的空间超出了应有的空间。
这不是一个大问题,但我想知道现在有什么好方法来解决它。另外,对存储库的这种“破坏性”编辑是否会影响与其他分叉的“兼容性”(即会在分叉之间推送更改时产生问题)?
谢谢!如果需要更多详细信息,请在评论中询问。
类似/相关于:如何清理 Mercurial 存储库?
For my current project I'm using Mercurial and hosting it on Bitbucket.
This was the first project I really properly used version control for, so I made a few mistakes starting out. One of these is that I stored all the (uncompressed) sound files that my project uses in the repository with the code.
As a result, right now even though I am no longer storing these files there, pulling for the first time from the server still takes quite a long time (I am guessing that the repository saves all of that so that I can recover back those files if I wanted to?) and the project occupies more space than it should.
It's not a huge issue, but I'm wondering what would be a good way to fix it now. Also, would this "destructive" editing of the repository affect "compatibility" with other forks (i.e. would create problems pushing changes between forks)?
Thanks! If any more details are needed, please just ask in the comments.
Similar/related to: How to cleanup Mercurial repository?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
convert
扩展 和命令重建存储库并在执行此操作时删除特定文件。然而,正如您猜对的那样,这种更改确实会创建新的更改集哈希,因此破坏了与其他分支的“兼容性”。You can use the
convert
extension and command to rebuild the repo and remove specific files while doing so. However, as you guessed correctly, this kind of changes do create new changeset hashes and therefore break the "compatibility" with other forks.是的,会的。你的想法很好!它将实际上成为一个新的存储库。
Yes, it will. Good thinking on your part! It will be effectively a new repository.