How to clone repository to a remote server/repository with Mercurial

后端 未结 3 906
说谎
说谎 2020-12-05 00:32

Found myself quite confused today about this.

I create a blank repository locally(hg init), cloned it to working copy, added some code, commited and pushed it(to loc

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-05 01:02

    If your "official" repositories are served up by an HTTP server, and you want to create a repo in the central location based on a local machine's repo, here's one way. You need admin rights on the central server to do this.

    e.g. I'm developing on windows, and my central repository is running on linux and served by lighttpd per the official guide. The server's central repo directory is /var/hg/repos/, owned by the user/group www-data. My local machine's IP is 10.1.10.100, and the repository I want to clone is named foo.

    1. On the local machine, open a command prompt into the repository directory and type hg serve. This runs the local hg web server, which will allow the server to pull from it.
    2. ssh into the central repo server, logging in as a user with sudo rights to www-data.
    3. cd /var/hg/repos
    4. sudo -u www-data hg clone http://10.1.10.100 foo

提交回复
热议问题