Discard all and get clean copy of latest revision?

后端 未结 5 2094
Happy的楠姐
Happy的楠姐 2021-01-29 19:21

I\'m moving a build process to use mercurial and want to get the working directory back to the state of the tip revision. Earlier runs of the build process will have modified so

5条回答
  •  旧巷少年郎
    2021-01-29 19:27

    To delete untracked on *nix without the purge extension you can use

    hg pull
    hg update -r MY_BRANCH -C
    hg status -un|xargs rm
    

    Which is using

    update -r --rev REV revision

    update -C --clean discard uncommitted changes (no backup)

    status -u --unknown show only unknown (not tracked) files

    status -n --no-status hide status prefix

提交回复
热议问题