Does Mercurial have an equivalent to git clean?

后端 未结 4 573
耶瑟儿~
耶瑟儿~ 2021-02-05 00:49

hg clean does not seem to exist, which kinda bothers me. Is this a feature that Mercurial doesn\'t have or did they just name it differently?

4条回答
  •  盖世英雄少女心
    2021-02-05 01:23

    If you are on a linux based system (or Windows cygwin) you can:

    hg status | grep "^?" | xargs rm -rf
    

    If this works you can put this in your ~/.hgrc:

    [alias]
    clean = !hg status | grep "^?" | xargs rm -rf
    

    Then simply run:

    hg clean
    

    I tested this on windows using cygwin (should work on linux).

提交回复
热议问题