How to do Mercurial's 'hg remove' for all missing files?
This will add all new files that are not ignored, and remove all locally missing files
hg addremove
Either of these will remove all locally missing files(They are the same command)
hg remove --after
hg remove -A
If you intend to do addremove and commit, it can be joined with '-A' option as shown here:
hg commit -A -m 'Commit with addremove'
The original question asked how to remove (i.e. forget) files that show up as "!"
when using hg st
. A direct approach which has the advantage of transparency is to use hg st
with the -n
option:
hg -v forget $(hg st -nd)
(Of course the files will only be forgotten at the next commit.)
The flags are well-documented elsewhere (e.g. by the hg command itself), but in brief:
-n
means "filename only"-d
means "select files that have been deleted"