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

后端 未结 12 662
刺人心
刺人心 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 09:09

    I personally use the following from the root of the repo:

    hg purge -p -I **/*.orig | xargs rm -f
    

    It's a little better than using just 'hg purge' or 'hg purge --all' because you can filter out the specific file types you want to include.

    For an explaination:

    • The -p argument prints the list of files to be purged
    • The -I argument whitelist filters the files to include
    • The resulting list is piped to xargs and executed using the rm -f command

提交回复
热议问题