38

I am using hg version 1.9.1. Problem is whenever I use hg update, I get an option of updating changed files. Do we have an option for forcefully updating all files to their new versions in the latest commit. Sorry but i did not find any useful information in hg manual.

prathmesh.kallurkar
  • 5,468
  • 8
  • 39
  • 50

1 Answers1

72
hg update --clean

This will update your working directory with the newest version of files in the current branch. Please note that this command will discard all existing changes in your working directory.

If you meant "can I get a fresh copy of each and every file from the repository" just delete all files in your working directory and do a hg update --clean again.

Sedat Kapanoglu
  • 46,641
  • 25
  • 114
  • 148
  • 1
    how does mercurial implement "hg update --clean" ?? Do they check for the changed files and then update them to new copies or they just blindly update all files to new version. The later option can be very costly i guess .. – prathmesh.kallurkar Jan 28 '12 at 05:45
  • Thanks for this answer. This is what worked for me. hg update -C – Benjamin Anderson Jul 01 '14 at 13:56
  • 1
    @BenjaminAnderson, the arguments `-C` und `--clean` are effectively the same. See `hg help update`: `-C --clean discard uncommitted changes (no backup)` – CodeFox Mar 22 '16 at 06:02