2010-07-24 123 views
47

提交比方說,我有當前status中刪除所有被刪除的文件接下來的Mercurial

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

如何批量從下​​remove文件4,5,6(!)提交?

目前,我只是手動刪除它們提交之前,像這樣的:

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

但是,有沒有辦法一氣呵成將它們全部刪除?

+2

[如何爲所有丟失的文件執行Mercurial'hg remove'?](http://stackoverflow.com/questions/2412239/how-to-do-mercurials-hg-remove-for-all-missing - 文件) – bernie 2010-07-24 19:05:58

回答

53

運行hg addremove

+34

'remove --after'可能更好(不添加文件) – tonfa 2010-07-24 23:04:30

+0

好點。我投了贊成票,但你應該加上這個答案。 – 2010-07-25 03:21:45

+0

我同意Ry4an,謝謝tonfa。 – Tovi7 2011-10-19 12:32:57

0

嘗試汞柱幫助系統

hg help 

,你會在開始得到命令:

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

所以你可以使用

hg addremove 
0

要麼 只是

hg addr 

:) 它是從

hg addremove 
20
hg remove --after 

快捷......可能是更好的(不添加文件)

這是直接從評論採取tonfa在接受的答案。我添加它是因爲它從未作爲單獨的答案添加。

相關問題