Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hg reset local repository to the state of remote one

Tags:

mercurial

how can I reset my local repository, to the state of remote one?

I have commited local changes (didn't push).

I want to delete all the differencies.

like image 461
Łukasz Gruner Avatar asked Jul 27 '11 15:07

Łukasz Gruner


People also ask

What does hg commit do?

hg commit: save your changes in the current repository. hg log: see all changes in your repository. hg pull: get all changes from another repository into the current one. hg push: get all changes from your repository into another one.

What is hg command?

The hg command provides a command line interface to the Mercurial system.


1 Answers

There are several options:

  1. Make a new clone of the remote repo and throw away the old clone.
  2. Make a new clone of the local repo, but limit it to the last revision in the remote. (e.g. hg clone -r <last remote changeset> <local_repo_old> <local_repo_new>).
  3. Use the hg strip command from the mq extension to remove the changesets from your local repo

NOTE: When trying options 2 or 3, you can use the hg outgoing command to see which changesets have not yet been pushed to the remote repo.

like image 181
Tim Henigan Avatar answered Oct 12 '22 09:10

Tim Henigan