Close the head without any changes.

I am working on a project that uses mercurial, and it got into a confusion with several heads that are dead for all intensive purposes.

I want to kill these heads and return the fix graph in one line.

I was told that there is a way to merge branches, but at the same time ignore any changes to the files, so, in fact, it’s just a tree merge, but I can’t work with a set of commands.

Is there a way to do this, kill branches by merging and ignoring file changes? Or, alternatively, is there a way to re-enable the schedule without changes (which are not massively irrelevant in the project)?

+6
mercurial
source share
2 answers

If you use TortoiseHg and named branches, you can select the branch option in the commit dialog to close the branch, and it will allow you to make transactions without actually changing the file.

It will still leave you with a head, but will be marked as inactive.

+5
source share

I think this is exactly what you are looking for: Save my or their files when merging

It will create new plugin changes that close the “other” chapter without any changes. You will not end the linear story, but in the end you will have one head.

Other lower answers include using hg strip or hg clone -r to eliminate heads / anonymous branches you don't want. They are inferior, because (a) if there are other clones, you cannot deprive them, it doesn’t work at all, and (b) they throw away a story that is the opposite of good version control practice - even the work that you don’t think you want now may be valuable someday.

+3
source share

All Articles