LoginSignup
6
1

More than 5 years have passed since last update.

hg-gitを使ってMercurialでGithubにアクセスする

Last updated at Posted at 2018-08-06

Mercurial を使って、Githubにアクセスしたいときに使うのが hg-git

でも hg-git のインストールで、

'module' object has no attribute 'ignore'

のエラーでかなり詰まったので、メモしておきます。

Mercurial のインストール

かなりしょぼい公式サイトを参考にすると事故ります。
http://hg-git.github.io/

インストール

公式サイトで https://bitbucket.org/durin42/hg-git のサイトから hg-git をインストールすると書いてあるので、レポジトリを見てみます。

ここの Makefile を見て、 ちゃんと動く Mercurial のバージョンを見ておく必要があります。
私がこの記事を書いている時点では、 4.5 でした。

普通に pip install mercurial としてしまうと、 4.5 よりも高いバージョンの Mercurial がインストールされてしまいますので、バージョン指定してインストールしましょう。

mercurialをインストール

pip install mercurial==4.5

次に、適当な場所に hg-git をクローンします。

cd coding/lib
hg clone https://bitbucket.org/durin42/hg-git

~/.hgrc に設定を書きます。

~/.hgrc
[ui]
username = xxx <yyy@zzz.com>
[extensions]
hgext.bookmarks =
hggit = /Users/zzzz/coding/lib/hg-git/hggit

hggit のパスは自分がクローンしたところに変更してください。

Githubにアクセス

普通に .git のURLをクローンできるようになります。

hg clone git@github.com:test/aaaaa.git
6
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
1