How can I permanently delete (destroy) files from history?

I committed (did not click) many files locally (including deleting and adding binaries ...), and now when I try to click, it takes a lot of time. In fact, I messed up the history of my local repo.

How could I avoid this error in the future? Can I convert the set of local versions 1-> 2-> 3-> 4 to 1-> 2, and 2 is the final revision of the local clone?

edit: since I was in a hurry, I started a new remote repo from scratch with version 4. In the future I will go with a noticeable answer, because it seems easier to me, but I will dig other solutions to see the truth. Thanks for your support.

+5
source share
2 answers

The mercury story is immutable; you cannot delete it with ordinary tools. However, you can create a new repo without these files:

$ hg clone -r 1 repo-with-too-much new-repo

which takes only revisions zero and one of the old repo and puts them in the new repo. Now copy the files from the fourth version to the new repo and commit.

This eliminates these inter-page change sets, but any repo you have in the wild still has them, so when you do pull, you will get them back.

In general, as soon as you click on a set of changes there, and if you cannot force everyone with a clone to delete it and cancel it, you are out of luck.

+1
source

, . , . - . MQ (mercurial queues). . wiki EditingHistory. , MQ .

, , , , "" , , ;)

+2

All Articles