Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm new to VCS and I decided to give Mercurial a try. I signed up for bitbucket and created some repositories. The I created /home/max/hgrepo/ and ran hg clone http://bitbucket.org/[username]/[repository]

That made a [repository] directory. I copied some source files into this directory. then I hg add, hg commit and hg push. Then I wanted to move my source files into a src directory instead of having them into the root dir. So I moved all the sources files down one directory to my src directory. I then ran hg add *, then hg commit and lastly hg push.

The problem I have is that the old sources files in the root directory of my repo are still there. How do I remove them? I don't have them in my local repo anymore. Is there a way to fully sync my local repository and my remote one?

share|improve this question
up vote 4 down vote accepted

You can use the addremove command to mark missing files (those prefaced with a !) as removed.

See the excellent Mercurial: the Definitive Guide chapter on tracking files.

For future reference, there is a command to move files, hg mv.

share|improve this answer
I didn't know about hg move, thanks. I'll have a look at the guide. – n0pe Aug 17 '11 at 19:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.