Mercurial 存储库中的文件路径对于 Windows 来说太长
我已将一些文件提交到 Mercurial 存储库,我想将其从存储库历史记录中永久删除。它只是在我没有添加到 .hgignore 的目录中测试输出。我通常不会关心,但文件路径非常长,当我尝试克隆到 Windows 计算机时,它会由于文件路径长度而中止。
我在一些地方读到不可能删除历史记录。还有其他解决方法吗?
I have committed some files to a mercurial repository that I want to permanently remove from the repository history. Its just test output in a directory that I hadn't added to .hgignore. I wouldn't normally care, but the file paths are very long and when I try to clone to a windows machine it aborts due the file path length.
I've read in a few places that its not possible to remove history. Is there any other workaround?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以从历史记录中完全删除文件,但是通过这样做,您基本上是在创建一个与前一个存储库无关的新存储库(因此它所具有的任何克隆将不再是克隆)。最简单的方法是使用转换扩展:
filemap
文件允许您指定在创建新历史记录时应跳过哪些文件:您可以在 Mercurial wiki 上找到更多信息:转换扩展,常见问题解答条目。
You can remove files from the history completely, but by doing so, you're basically creating a new repository, unrelated to the previous one (so any clone it has will no longer be a clone). The easiest way is to use convert extension:
The
filemap
file allows you to specify which files should be skipped over when creating the new history:You can find more information on the Mercurial wiki: convert extension, FAQ entry.