Push to remote Mercurial repository

16,361

If your VPS has Mercurial installed, simply:

hg push ssh://username@host/path/relative/to/home

or add to the repo's hgrc

[paths]
default-push = ssh://username@host/path/relative/to/home

and just

hg push
Share:
16,361
richzilla
Author by

richzilla

Updated on June 03, 2022

Comments

  • richzilla
    richzilla about 2 years

    I have a Mercurial repository on a remote VPS. The VPS has SSH access enabled. What are my options for pushing code changes from my development machine to the remote VPS?

  • deadbeef404
    deadbeef404 about 10 years
    FYI for anyone else that comes here, before attempting the above: When doing hg push, you need a double slash after hostname, for an absolute path. See this answer.
  • RedGlyph
    RedGlyph about 10 years
    No, it's not needed, it just means something else. A double slash makes the path absolute on the host, a single slash is relative to home (as correctly mentioned in Lazy Badger's answer).
  • deadbeef404
    deadbeef404 about 10 years
    @RedGlyph, you are correct. I've updated my post to be slightly clearer about my meaning.
  • alexzander
    alexzander almost 3 years
    but what if i want to push to /run/media/$DEVICE_LABEL, not in home dir of user ?
  • Clonkex
    Clonkex over 2 years
    @alexzander Then you would use the double slash after the hostname as mentioned by deadbeef404.