How to automatically remove all .orig files in Mercurial working tree?

后端 未结 12 685
刺人心
刺人心 2020-12-13 08:34

During merges mercurial leaves .orig file for any unresolved file. But after manually resolving problems and marking a file correct it does not delete the .orig file. Can it

12条回答
  •  清歌不尽
    2020-12-13 08:49

    Personally, I use

    $ rm **/*.orig
    

    if I get tired of the .orig files. This works in Zsh and in Bash 4 after you run shopt -s globstar.

    But if you use another shell or want a built-in solution, then maybe you'll like the purge extension (link updated 2016-08-25). That lets you remove all untracked files with

    $ hg purge
    

    You can remove all untracked and ignored files with

    $ hg purge --all
    

    An advantage of using hg purge is that this will also cleanup directories that become empty after removing the files. The rm command line will just leave the empty directories behind.

提交回复
热议问题