将 HG 项目从 Bitbucket 镜像到 Github
是否有一个有效的工作流程来将主要使用 Hg 托管在 bitbucket 上的项目镜像到 github?
Is there an efficient workflow to mirror a project that is mainly hosted on bitbucket using Hg, to github?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
您可以使用诸如
hg-git
至:You could use a tool like
hg-git
to:如果您将 Mercurial 用于项目,您可以快速轻松地为项目创建 git 镜像,以便 git 用户可以做出贡献。我在 GitHub 上创建了一个有关使用
hg-git
管理 Mercurial 镜像的教程。它涵盖了如何开始使用 GitHub 帐户、如何将项目从 Mercurial 推送到 GitHub,以及如何接受来自 GitHub 的贡献(拉取请求)。以下是博客文章的链接:http:// /hgtip.com/tips/advanced/2009-11-09-create-a-git-mirror/ 存档于 http://web.archive.org/web/20100811223113/http:// hgtip.com/tips/advanced/2009-11-09-create-a-git-mirror/
If you use Mercurial for a project you can quickly and easily make a git mirror of your project so that git users can contribute. I created a tutorial about using
hg-git
to manage Mercurial mirrors on GitHub.It covers how to get started with a GitHub account, how to push up a project from Mercurial to GitHub, and how to accept contributions (pull requests) from GitHub. Here's a link to the blog post: http://hgtip.com/tips/advanced/2009-11-09-create-a-git-mirror/ archived at http://web.archive.org/web/20100811223113/http://hgtip.com/tips/advanced/2009-11-09-create-a-git-mirror/
添加 git-remote-hg 到您的 bin 路径。然后你可以按照github上提到的镜像。
然后,最后进入您的克隆存储库
,同步您的镜像
Add git-remote-hg to your bin path. Then you can mirror as mentioned on github.
then, go into your cloned repo
finally, sync your mirror
截至 2013 年 7 月,出现了 BitSyncHub Web 服务,用于通过 BitBucket 接收后挂钩自动执行此过程。不过,您需要授予服务对 GitHub 存储库的写入权限(添加 bitsynchub 作为贡献者)。
As of July 2013 there is BitSyncHub a web service for automating this process via a BitBucket post-receive hook. You will need to grant the service write permission to your GitHub repository though (add bitsynchub as a contributor).
我是从 2019 年 2 月开始报告的。我刚刚遇到了这个问题,按照 @vonc 的建议使用 hg-git,并填补了一些缺失的步骤以使其正常工作。在这里我将提供更详细的指南:
我在源存储库中找到了最新的安装说明:https://bitbucket.org/durin42/hg-git。所以请留意这一点。
安装dulwich(如果尚未安装):
pip install dulwich
。在 GitHub 上创建一个新的空存储库,例如 https://github.com/user/git -mirror。
克隆 hg 源码仓库,并将其推送到 git 镜像:
I'm reporting from Feb 2019. I just encountered this problem, followed @vonc's suggestion to use hg-git, and filled a few missing steps to make it work. Here I'll provide a more detailed guide:
I found the most up-to-date installation instructions in the source repository: https://bitbucket.org/durin42/hg-git. So keep an eye that.
Install dulwich if not already:
pip install dulwich
.Create a new empty repository on GitHub, for example https://github.com/user/git-mirror.
Clone the hg source repository, and push it to the git mirror:
另一种可用于快速转换的解决方案:https://github.com/frej/fast-export
One more available solution to quickly convert: https://github.com/frej/fast-export
您可以使用 Git-hg 镜像服务 来执行此操作(包括将 GitHub 存储库镜像到 Bitbucket,或双向同步) 。
You can use the Git-hg Mirror service to do this (including mirroring a GitHub repo to Bitbucket, or syncing bidirectionally).