I typed hg init
in a directory, but then changed my mind: I'd rather not have this under version control. So how do I undo hg init
?
I suppose there is another solution than deleting .hg
directories, but I couldn't find the command. Or is it impossible for mercurial to remove itself from a project?
Reverting Local Changes If you use the TortoiseHg client to work with Mercurial from TestComplete, you can cancel all local changes not committed to the repository yet: Select File > Source Control > Revert from the TestComplete main menu.
hg rollback reverts the last transaction, so you'd be left with unfinished merge, which you have to use hg update -C to get out. If you don't want *b (you have it in another clone), then enable the built-in MQ extension and run hg strip -r <*b> . It will get rid of *b and *merge.
If you are still in the draft phase (not pushed elsewhere yet), use the built-in extension hg strip <rev> command. Otherwise, you should do a hg backout , which will reverse the changeset. In case you still need the commit you made, I suggest you export it to import it again in the correct branch, before stripping.
Why don't using
rm -rv .hg/
on Linux/Unix systems or under MacOS
or
rmdir /S .hg
on WIndows systems (with the good ol' cmdline, the first example works under the PowerShell too).
It's simple and effective and does what you want: Removing Mercurial from the project.
The only thing hg init
does is adding the .hg
directory and its contents.
So, undoing a hg init
can indeed be done by simply deleting the .hg
directory. It really cannot get any easier than this!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With