我希望从Google Code和Mercurial迁移到Git和GitHub,同时保留所有分支和版本历史记录。
到目前为止,似乎Hg-Git mercurial插件(http://hg-git.github.com/)是我唯一的选择。我试着按照安装说明进行操作,但是我有点过头了。我就在这里:
[extensions]
hgext.bookmarks =
hggit =
现在我跑的时候:
C:\Python27\Scripts>easy_install.exe hg-git
我得到以下内容:
Searching for hg-git
Best match: hg-git 0.3.3
Processing hg_git-0.3.3-py2.7.egg
hg-git 0.3.3 is already the active version in easy-install.pth
Using c:\python27\lib\site-packages\hg_git-0.3.3-py2.7.egg
Processing dependencies for hg-git
Searching for dulwich>=0.8.0
Reading http://pypi.python.org/simple/dulwich/
Reading http://samba.org/~jelmer/dulwich
Reading http://launchpad.net/dulwich
Best match: dulwich 0.8.5
Downloading http://samba.org/~jelmer/dulwich/dulwich-0.8.5.tar.gz
Processing dulwich-0.8.5.tar.gz
Running dulwich-0.8.5\setup.py -q bdist_egg --dist-dir c:\users\lee\appdata\local\temp\easy_install-3qgeev\dulwich-0.8.5\egg-dist-tmp-ciyt_4
然后是一堆看起来像这样的错误:
Traceback (most recent call last):
File "C:\Python27\Scripts\easy_install-script.py", line 8, in <module>
load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 1712, in main
with_ei_usage(lambda:
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 1700, in with_ei_usage
return f()
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 1716, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "C:\Python27\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 211, in run
self.easy_install(spec, not self.no_deps)
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 446, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 481, in install_item
self.process_distribution(spec, dists[0], deps, "Using")
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 519, in process_distribution
[requirement], self.local_index, self.easy_install
File "C:\Python27\lib\site-packages\pkg_resources.py", line 563, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File "C:\Python27\lib\site-packages\pkg_resources.py", line 799, in best_match
return self.obtain(req, installer) # try and download/install
不确定下一步该尝试什么。我也尝试过Cloning github repo with hggit的提示,但我遗漏了一些明显的东西。任何帮助将不胜感激。
答案 0 :(得分:2)
刚刚起草和一些笔记和想法:
\ TortoiseHg \ plugins&gt; dir / B
HG-git的
...
[扩展]
...
hggit = c:\ Program Files_Tools \ TortoiseHg \ plugins \ hg-git \ hggit
...
书签扩展,作为默认扩展,与THG捆绑在一起,在某些版本的GUI中启用,现在可以在mercurial.ini中找到bookmarks =
而没有设置 - 扩展中的相应复选框
使用TortoiseHG中的功能性hg-git(克隆,拉动,推送没有错误的某些Git-repo ),您可以尝试将外部Mercurial仓库转换为外部Git仓库
[paths]
部分中的新字符串),仅限git+ssh://git@github.com/username/reponame.git
URL(基于密钥的身份验证) over PageAnt)是透明的解决方案屏幕截图只是我在GitHub上的活跃Git仓库的示例,并试图通过实时来源说明我的话
答案 1 :(得分:0)
我也和hg-git斗争。我想出了一个奇怪的解决方案。
我用https://import.github.com/new导入了hg repo 这并不奇怪,必须是你所寻找的。 p>
奇怪和奖励部分如下:
.hg/
.gitignore
.hg/
和.git/
添加到您的.gitignore
文件中
.git/
.hg/
在本地仓库中输入.hg
目录,并将.gitignore
文件符号链接为.hgignore
$ ln -s ../.gitignore .hgignore
现在.gitignore
hg
所做的任何更改
$ git add .gitignore -am&#39; gitignore&#39;
$ hg add .gitignore -am&#39;不要忘记在.hg /文件夹中将符号链接.gitignore作为.hgignore&#39;
$ hg push default
$ git push origin master
结论:虽然看起来效率低下,但它在利用github的同时不会丢失hg repo和数据库,并且有机会同时使用git
和hg