Say I type hg add
in Mercurial, and there a bunch of untracked files in my working directory that are not ignored. What is the easiest way to un-add all those files without explicitly typing the name of each file?
Can I just un-add them all with one command?
To revert a file to a specific changeset, use hg revert -r CHANGESET FILENAME . This will revert the file without committing it.
If you see the help for hg rm --help : hg remove [OPTION]... FILE... Schedule the indicated files for removal from the current branch. This command schedules the files to be removed at the next commit.
This extension purges all files and directories not being tracked by Mercurial in the current repository. It'll remove unknown files and empty directories by default. With the --all option, it will also remove ignored files. It keeps added files and (unmodified or modified) tracked files.
Preface
You must always ask questions, which contain as much information as possible. Because now your question, depending from some conditions, may have totally different answers.
Case One - no local modifications in already versioned files, only added (and not committed) files
hg revert
will return your working directory to the state after the last commit, undoing all changes it it.
Case One - local edits, which you want to save and occasionally added files
hg forget
command, something like hg forget "set:added()"
.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