55

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 ?

1

4 Answers 4

64

Run hg addremove

2
  • 39
    remove --after is probably better (doesn't add files)
    – tonfa
    Jul 24, 2010 at 23:04
  • good point. I voted for close on the dupe, but you should add that answer anyway. Jul 25, 2010 at 3:21
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.

1

Or just

hg addr

:) it is shortcut from

hg addremove
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.