I typed
$ hg addremove
but later realized that some of the files should not be part of the commit. What I should have done was to add these files to .hgignore and after that run addremove and commit.
Is there a way of fixing this?
If you have not commited yet just use hg forget fileToForget
or use Tortoise to remove the files.
If you have committed and you don't mind the files to be part of history, just forget them and commit again.
If you don't want them to be part of your repository history, and if commiting them is the very last operation you've made, you can try to rollback (use hg rollback
or go in the recovery menu in Tortoise). You will have to forget the file and then commit again
If you're dealing with too many files, you can try to automate the task by getting a list of all added files, forgetting them, modify you .hgignore
and do the addremove
again.
Example of the first step in powershell with no commit made
hg status --added --no-status | foreach-object {hg forget $_};
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