Mercurial:从所有变更集中删除文件
我了解如何从历史记录中删除整个变更集,但不清楚如何删除子集。
例如,如何从现有变更集中删除所有 DLL 文件,同时保留源代码?
I understand how to remove an entire changeset from history but it's not clear how to remove a subset instead.
For example, how do I remove all DLL files from an existing changeset while leaving the source-code alone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于修订 ID(例如 a8d7641f...)基于变更集的哈希,因此实际上不可能从历史记录中删除变更集的子集。
但是,可以使用 转换 扩展名。您将把 Mercurial 存储库转换为 Mercurial 存储库,并使用文件映射通过添加
排除
来排除您不需要的文件。这将创建一个新的、不相关的存储库,这意味着人们将无法再从中提取任何克隆,并且必须从这个新存储库重新克隆。Because the revision ids (e.g. a8d7641f...) are based on a hash of the changeset, it's not really possible to remove a subset of a changeset from history.
However, it is possible to create a new repo with a parallel history, except for a certain set of files, by using the Convert extension. You'll be converting a Mercurial repo to a Mercurial repo, using the filemap to exclude the files you don't want by adding
exclude
s. This will create a new, unrelated repository, which means that any clones people have won't be able to pull from it any more, and will have to re-clone from this new repo.中央存储库(如果有)
注意:即使在 Windows 上,您也必须在路径中使用“正斜杠”。
c:\newrepo
处有了一个新的存储库,但没有文件PS。在“上层”存储库中,您必须删除所有变更集并重新推送您的新存储库。
聚苯硫醚。我实际上写了一篇关于此的博客文章,其中包含更多详细信息(包括剥离Bitbucket 等方面的变化
central repo (if any)
NOTE: You have to use "forward-slash" in paths, even on windows.
c:\newrepo
but without the filesPS. In the "upper" repo you have to remove all changesets and re-push your new repo.
PPS. I actually wrote a blog post about this that has more details (including stripping the changesest in Bitbucket etc.