您应该在工作站本地完成hg-git 进程(如)。hg gexport
然后,当你有一个 git repo 镜像你的初始 Hg repo 时,你可以添加一个 GitHub 源,并推送到它:
git remote add origin https://github.com/user/yourProject.git
git push origin master
git push --all
但是,Lazy Badger 评论说,OP 可能只想在此过程中使用 Mercurial,而根本不安装 Git,这是正确的。
在这种情况下,页面“ hg-git on GitHub ”包含:
如果您从现有的 Hg 存储库开始,则必须在具有推送访问权限的某个地方设置 Git 存储库,将其添加为默认路径或默认推送路径.hg/hgrc,然后hg push在您的项目中运行。
例如:
$ cd hg-git # (an Hg repository)
$ # edit .hg/hgrc and add the target git url in the paths section
$ hg push
这会将您所有的汞数据转换为 Git 对象并将它们推送到 Git 服务器。