What specific steps to I need to take to set it up?

Do I need special post-commit hooks to update the remote copy of the site?

Do I need SSH access to the remote server?

I'm looking for a setup where I can push the changes to the remote repository and the changes will be published to the website.

1 Answer 1


You can configure Mercurial to run a web server using the hg serve command. A list of runtime options on hg serve are available here.

Once you have your web server set up, hg clone http://servername:port will pull a copy of the server's resources, and hg push from that directory will update the server.

To force the server to update itself upon receiving a new push, add the following to the .hg/hgrc file in the repository:

changegroup = hg update >&2

This should accomplish what you're looking for.

  • Wow... thank you so much. I think I searched google for 4 hours and still couldn't find a good answer to this question. Jul 8, 2010 at 22:11
  • My pleasure! :) It took me a lot of searching to figure this out, too.
    – Soleil
    Jul 8, 2010 at 22:16
  • one other question. Would I still need to install mercurial on the remote server over SSH? Jul 9, 2010 at 9:25
  • SSH or at the console directly, yes.
    – Soleil
    Jul 9, 2010 at 14:10
  • I'm going to modify one of my tutorials to include your last suggestion, with proper attribution of course :)
    – Tim Post
    Jul 13, 2010 at 2:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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