54

Let's say I have the current status:

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

How do I bulk remove files 4, 5, 6 (!) from the next commit?

At the moment, I am just removing them manually before committing, like such:

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

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

Andreas Grech
  • 105,982
  • 98
  • 297
  • 360
  • 2
    duplicate of [How to do Mercurial's 'hg remove' for all missing files?](http://stackoverflow.com/questions/2412239/how-to-do-mercurials-hg-remove-for-all-missing-files) – mechanical_meat Jul 24 '10 at 19:05

4 Answers4

63

Run hg addremove

Ry4an Brase
  • 78,112
  • 7
  • 148
  • 169
27
hg remove --after

...is probably better (doesn't add files)

This is taken straight from the comment by tonfa in the accepted answer. I'm adding it because it was never added as a separate Answer.

justin.hughey
  • 1,246
  • 15
  • 16
1

Or just

hg addr

:) it is shortcut from

hg addremove
Pasha
  • 642
  • 6
  • 22
0

try the hg help system

hg help

and you will get the command in 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
hustljian
  • 965
  • 12
  • 9