How do I delete all untracked files from my working directory in Mercurial?

前端 未结 10 498
长情又很酷
长情又很酷 2021-01-29 18:11

Is it possible to delete all untracked files from my working directory? Let\'s say I added a bunch of files to my working directory, didn\'t add them via \'hg add\' and now want

相关标签:
10条回答
  • 2021-01-29 18:51

    This should do the trick:

    hg status | grep '^\?' | sed 's/^\? //' | xargs rm -rf
    
    0 讨论(0)
  • 2021-01-29 18:59

    The proper way without purge is:

    hg st -un0 | xargs -0 rm
    
    0 讨论(0)
  • 2021-01-29 18:59

    if you don't want to use purge:

    rm $(hg st | grep ^? | awk '{print $2}')
    
    0 讨论(0)
  • 2021-01-29 19:02

    You can use

    hg purge --all
    

    to remove all the ignored and untracked files

    (first you need to install the purge extension as explained in some answers)

    0 讨论(0)
提交回复
热议问题