【问题标题】:Push to remote Mercurial repository推送到远程 Mercurial 存储库
【发布时间】:2011-10-01 23:27:52
【问题描述】:

我在远程 VPS 上有一个 Mercurial 存储库。 VPS 启用了 SSH 访问。将代码更改从我的开发机器推送到远程 VPS 有哪些选择?

【问题讨论】:

    标签: mercurial ssh push


    【解决方案1】:

    如果您的 VPS 安装了 Mercurial,只需:

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

    或添加到 repo 的 hgrc

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

    只是

    hg push
    

    【讨论】:

    • 在尝试上述操作之前,仅供任何其他人参考:在进行 hg push 时,您需要在主机名后使用双斜杠作为绝对路径。见this answer.
    • 不,不需要,它只是意味着别的东西。双斜杠使主机上的路径是绝对的,单斜杠是相对于家的(正如 Lazy Badger 的回答中正确提到的那样)。
    • @RedGlyph,你是对的。我更新了我的帖子,让我的意思更加清晰。
    • 但是如果我想推送到/run/media/$DEVICE_LABEL,而不是在用户的主目录中呢?
    • @alexzander 然后你会在 deadbeef404 提到的主机名之后使用双斜杠。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-18
    • 2018-06-24
    • 2010-10-25
    • 1970-01-01
    相关资源
    最近更新 更多