[英]Mercurial: Removing a single, non-head, changeset
How do I remove a single changeset (which is not a head) from a repository? 如何从存储库中删除单个变更集(不是头部)?
hg strip
doesn't work because I don't wanna remove the descendants. hg strip
不起作用,因为我不想删除后代。 hg rebase
on a head and then hg strip
would work, but I can't rebase on a descendent. hg rebase
在头上重新建立hg strip
,然后hg strip
可以工作,但是我无法在后代上重新建立基准。 (that yields an error) My changeset is not related to anything else (it's just a bunch of file adds I shouldn't have made), so it should be easy to remove without problems. 我的变更集与其他任何内容都不相关(它只是我不应该添加的一堆文件),因此应该很容易删除而不会出现问题。 Also, my repository in fact has a linear history (each changeset only has one child and in particular, there's only one head).
此外,我的存储库实际上具有线性历史记录(每个变更集只有一个孩子,尤其是只有一个孩子)。
I'm using hgsubversion and either it or my SVN server crash when I try to push a commit that touches any file that has umlauts in its name. 我正在使用hgsubversion,当我尝试推送涉及其名称中有变音符号的任何文件的提交时,它或SVN服务器崩溃。 I accidentally added such a file and then did some other work on top of it.
我不小心添加了这样的文件,然后在它上面做了其他工作。 Now the offending commit needs to be removed.
现在,需要删除有问题的提交。
As ngoldbaum implied in a comment , strip removes descendants , not ancestors. 正如ngoldbaum所暗示的那样 ,strip删除了后代 ,而不是祖先。 If there are no descendants you're OK.
如果没有子孙,您就可以了。 (Watch out, though: descendants in another branch will be stripped!)
(但是请注意:另一个分支的后代将被剥夺!)
If your issue is that the commit has descendants, you can still use hg histedit
to remove it while keeping its descendants. 如果您的问题是提交包含后代,则仍可以使用
hg histedit
将其删除,同时保留其后代。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.