3

In Mercurial, what is the difference between

hg revert --all 

and

hg up -C?

It seems that both commands revert all changes. But what is the difference?

user1941537
  • 6,097
  • 14
  • 52
  • 99
  • Possible duplicate of [Difference between Revert and Update in Mercurial](https://stackoverflow.com/questions/2506803/difference-between-revert-and-update-in-mercurial) – StayOnTarget May 28 '19 at 11:38

1 Answers1

4
  • with hg up you actually switch to another revision (possibly abandoning your current branch)

  • with hg revert --all you change all files to be the same as in another revision, but remaining on you current working directory (and branch), meaning you can proceed with commit, or modify a couple of stuff before making such commit

it is more common to hg revert one single file, and that is why when you revert them all Mercurial asks you whether you are sure about that, or else want to perform an update instead

arhak
  • 2,488
  • 1
  • 24
  • 38
  • 2
    yes they are the same, it is an alias, see `hg help update` lists `aliases: up, checkout, co` – arhak May 27 '19 at 20:51