如何将本地 Subversion 存储库转换为托管在 bitbucket 上的 hg?

发布于 2024-10-16 21:49:58 字数 699 浏览 7 评论 0原文

目前,我使用网络上的本地 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

同尘 2024-10-23 21:49:58

这很容易。

  1. 安装hgsubversion
  2. 为您的存储库的 Hg 版本创建一个文件夹:
    mkdir MooDB_hg
    cd MooDB_hg
  3. SVN 存储库克隆到本地文件夹:
    hg 克隆 svn+http://carbon.local/svn/main/WebSites/MooDB
  4. 将其推送到 bitbucket:
    hg推送https://bitbucket.org/keymoo/moodb

That's easy.

  1. Install hgsubversion.
  2. Create a folder for Hg version of your repository:
    mkdir MooDB_hg
    cd MooDB_hg
  3. Clone your SVN repository to the local folder:
    hg clone svn+http://carbon.local/svn/main/WebSites/MooDB
  4. Push it to bitbucket:
    hg push https://bitbucket.org/keymoo/moodb
蓦然回首 2024-10-23 21:49:58

您的存储库和源代码肯定已被复制。您可以将 .hg 目录视为存储库,就像您的 Subversion 服务器一样,只不过它是本地的。 Mercurial 在本地保留整个存储库的副本。您看不到任何文件的原因是您尚未签出特定修订版,您可以通过输入转换后的存储库所在的目录并输入 hg update 来签出。

如果要将存储库上传到 Bitbucket,则必须根据 Bitbucket 文档在存储库的 .hg/hgrc 文件中配置 Bitbucket 存储库。然后,您可以使用 hg push 将存储库推送到 Bitbucket。

更具体地说,您需要告诉您的存储库在哪里可以找到您的远程存储库。下面是我在 Bitbucket 创建的测试存储库的示例:

[paths]
default = https://[email protected]/csstaub/test

它告诉 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 typing hg 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 using hg 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:

[paths]
default = https://[email protected]/csstaub/test

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:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文