How do I move a private Mercurial repository to a central server?

前端 未结 2 1505
孤街浪徒
孤街浪徒 2021-02-05 17:22

I’m just getting started with Mercurial, and I’ve read Joel Spolsky’s Hg Init tutorial, which I liked.

I’m wondering: let’s say I have a private repository and I work on

2条回答
  •  迷失自我
    2021-02-05 17:57

    BitBucket's help says it's as easy as making an empty repo on BitBucket, then pushing to it:

    ... create a new empty repository via the "Create repository" page. We will assume that this repository is named blonk and is to be found on http://bitbucket.org/jespern/blonk.

    Now, just push to it:

      $ cd ~/Work/blonk # our existing hg repository
      $ hg push http://bitbucket.org/jespern/blonk
      ...
    

    Done!

    You can edit .hg/hgrc in your repository to include the default path to Bitbucket:

      $ cat .hg/hgrc
      [paths]
      default = http://bitbucket.org/jespern/blonk
    

    Now you can simply enter hg push and hg pull without having to specify the full URL.

提交回复
热议问题