How to do Mercurial's 'hg remove' for all missing files?

后端 未结 4 1395
夕颜
夕颜 2020-12-22 16:12

I use this to remove a file from the repo:

hg remove  

What command can you use to do an hg remove on

4条回答
  •  没有蜡笔的小新
    2020-12-22 16:50

    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"

提交回复
热议问题