2

すべてのブランチとバージョン履歴を保持しながら、GoogleCodeと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

次に何を試すべきかわからない。また、hggitを使用してgithubリポジトリのクローンを作成する際のヒントに従ってみましたが、明らかなものがありません。どんな助けでも大歓迎です。

4

2 に答える 2

2

ドラフトといくつかのメモと考え:

  • TortoiseHGを使用するために(Windowsでは、重要な場合はXP SP3)Pythonは必須ではありません-Python / setuptools/pipなしでTHGを使用しています
  • BitbucketのTortoiseHG(32ビットまたは64ビット)は、Windowsの世界では自給自足のMercurialです。
  • TortoiseHGにhg-git拡張機能を手動で追加しました

\ TortoiseHg \ plugins> dir / B

hg-git

..。

  • グローバルmercurial.ini(Documents and Settings \ Badger \ mercurial.ini)にhg-git拡張機能を追加しました

[拡張機能]

..。

hggit = c:\ Program Files_Tools \ TortoiseHg \ plugins \ hg-git \ hggit

..。

  • bookmarks =THGにバンドルされているデフォルトの拡張機能であるブックマーク拡張機能は、いくつかのバージョンの前にGUIで有効になっており、[設定]-[拡張機能]の対応するチェックボックスがないため、mercurial.iniで見つけることができます。

  • TortoiseHGの機能的なhg-git(一部のGitリポジトリではエラーなしでクローン、プル、プッシュ)を使用すると、外部のMercurialリポジトリを外部のGitリポジトリに変換できます。

    • CG Mercurialリポジトリをローカル(Mercurial)リポジトリにクローンします
    • Githubに新しい空のGitリポジトリを作成します(認証およびその他の考えられる問題を確認します)
    • 2番目のリモートリポジトリを追加します(GUI-[同期]タブ、手動-[paths]リポジトリの.hg \ hgrcのセクションに新しい文字列)。私にとっては、git+ssh://git@github.com/username/reponame.gitURL(PageAntに対するキーベースの認証を使用)のみが透過的なソリューションです。
    • ローカルリポジトリをgithubにプッシュする
    • 楽しんで

スクリーンショットは、GitHub上のアクティブなGitリポジトリの単なる例であり、ライブソースで私の言葉を説明しようとしています

ファイバーレポ

于 2012-09-24T01:49:29.103 に答える
1

私もhg-gitで苦労しました。私は奇妙な解決策を思いつきます。

https://import.github.com/newでhgリポジトリをインポートしました。 これは奇妙なことではなく、探しているものでなければなりません。


奇妙でボーナスのセクションは以下の通りです:

  • http://bitbucket.orgでhgミラーリポジトリを作成しました
  • gitリポジトリ内にローカルhgリポジトリを作成しました。
  • 私は自分に追加.hg/しました.gitignore
  • ファイル に追加.hg/.git/ます.gitignore .git/ .hg/
  • ローカルリポジトリにディレクトリを入力し、次のようにファイルを.hgシンボリックリンクします.gitignore.hgignore

    $ ln-s../。gitignore.hgignore

  • これで、あなたに加えられた変更は、.gitignoreによっても考慮されますhg

    $ git add .gitignore -am'gitignore'

    $ hg add .gitignore-am'.hg/フォルダー内の.hgignoreとして.gitignoreをシンボリックリンクすることを忘れないでください'

    $ hg push default

    $gitプッシュオリジンマスター

結論:非効率に見えますが、hgリポジトリとデータベースを失うことなく、githubの利点を活用し、両方を使用する機会を提供しますgithg

于 2014-12-11T12:47:27.447 に答える