如何将本地 Subversion 存储库转换为托管在 bitbucket 上的 hg?
目前,我使用网络上的本地 Debian Linux 计算机使用 Subversion 对 ASP.NET 和 C# 源代码进行了版本控制。我的存储库本地路径是: http://carbon.local/svn/main/WebSites/MooDB
我想将我的源代码移至 Mercurial 并将其托管在 bitbucket.org 上。我已经在 bitbucket 上设置了一个帐户,想要将本地 SVN 转换为 Hg,然后将包含历史记录的存储库上传到 bitbucket。 bitbucket 存储库在这里:
https://bitbucket.org/keymoo/moodb
我已经做了一些谷歌搜索并在临时工作目录中尝试此操作(在 Windows 7 上运行并安装了 TortoiseHg):
hg Convert http://carbon.local/svn/main/WebSites/MooDB
这将创建一个 .hg 文件夹我运行命令但我的源代码尚未复制。我也不确定如何将存储库和历史记录放入位桶中。请帮忙,我只想尽快在 bitbucket 上启动并运行我的存储库+历史记录。
I currently have my ASP.NET and C# source code versioned using a local Debian Linux machine on my network using Subversion. My local path to the repo is: http://carbon.local/svn/main/WebSites/MooDB
I want to move my source code to Mercurial and have it hosted on bitbucket.org. I've set up an account on bitbucket and want to convert my local SVN to Hg and then upload the repo complete with history to bitbucket. The bitbucket repo is here:
https://bitbucket.org/keymoo/moodb
I've done some googling and tried this in a temp working directory (running this on Windows 7 and have installed TortoiseHg):
hg convert http://carbon.local/svn/main/WebSites/MooDB
This creates a .hg folder where I ran the command but my source code has not been copied. I'm also unsure how to get the repo and history into bitbucket. Please help, I just want to get up and running with my repo+history on bitbucket ASAP.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这很容易。
mkdir MooDB_hg
将cd MooDB_hg
hg 克隆 svn+http://carbon.local/svn/main/WebSites/MooDB
hg推送https://bitbucket.org/keymoo/moodb
That's easy.
mkdir MooDB_hg
cd MooDB_hg
hg clone svn+http://carbon.local/svn/main/WebSites/MooDB
hg push https://bitbucket.org/keymoo/moodb
您的存储库和源代码肯定已被复制。您可以将
.hg
目录视为存储库,就像您的 Subversion 服务器一样,只不过它是本地的。 Mercurial 在本地保留整个存储库的副本。您看不到任何文件的原因是您尚未签出特定修订版,您可以通过输入转换后的存储库所在的目录并输入hg update
来签出。如果要将存储库上传到 Bitbucket,则必须根据 Bitbucket 文档在存储库的
.hg/hgrc
文件中配置 Bitbucket 存储库。然后,您可以使用hg push
将存储库推送到 Bitbucket。更具体地说,您需要告诉您的存储库在哪里可以找到您的远程存储库。下面是我在 Bitbucket 创建的测试存储库的示例:
它告诉 Mercurial“有一个名为 default 的远程存储库,它位于以下地址”。您必须获取存储库的地址,如 Bitbucket 页面上所示。然后,您可以执行
hg Push
将存储库推送到 Bitbucket。以下是一些可帮助您入门的 Bitbucket 文档链接:
Your repository and source code have certainly been copied. You can think of the
.hg
directory as being the repository, like your Subversion server, except it's local. Mercurial keeps a copy of the whole repository locally. The reason you can't see any files is because you haven't checked out a specific revision yet, which you can do by entering the directory where your converted repository is and typinghg update
.If you want to upload your repository to Bitbucket, you will have to configure the Bitbucket repository within your repository's
.hg/hgrc
file according to the Bitbucket documentation. You can then push the repository to Bitbucket usinghg push
.More specifically, you need to tell your repository where it can find your remote repository. Here's an example with a test repository I created at Bitbucket:
That tells Mercurial "there is a remote repository with the name default and it is located at the following address". You have to take the address of your repository as shown on it's Bitbucket page. Then you can do an
hg push
in order to push the repository to Bitbucket.Here are some links to the Bitbucket documentation to get you started: