Delete all deleted files in the next commit using Mercurial

Let's say I have the current status :

 M File1.cs M File2.cs M File3.cs ! File4.cs ! File5.cs ! File6.cs 

How can I load remove files 4, 5, 6 ( ! ) From the next commit?

For the moment, I simply delete them manually before committing, for example:

 hg remove File4.cs hg remove File5.cs hg remove File6.cs 

But is there a way to remove them all in one go?

+44
mercurial
Jul 24 '10 at 19:02
source share
4 answers

Run hg addremove

+53
Jul 24 '10 at 19:55
source share
— -
 hg remove --after 

... maybe better (doesn't add files)

This is taken directly from the tonfa comment in the accepted answer. I add it because it was never added as a separate answer.

+18
Jan 20 '15 at 15:34
source share

Or simply

 hg addr 

:) this is a shortcut from

 hg addremove 
+1
May 3 '14 at 11:18
source share

try hg help system

 hg help 

and you will get the command at the beginning:

 list of commands: add add the specified files on the next commit addremove add all new files, delete all missing files ... 

so you can use

 hg addremove 
0
Jan 09 '13 at 6:26
source share



All Articles