SSH 経由でリポジトリを作る
posted by Steve Losh on October 2, 2009
どこか別のコンピューターにたくさんリポジトリがあって、 SSH で push と pull しているとしましょう。
ローカルに新しいリポジトリを作って作業を行い、 それからサーバー側にそのリポジトリを作成したいとしたら? 最も一般的な方法では、 まず、サーバーへログインし、空のリポジトリを作るでしょう:
$ ssh yourserver
$ cd path/to/repos
$ hg init newrepo
$ logout
$ hg push ssh://yourserver/path/to/repos/newrepos
これでも構いませんが、ちょっとタイプしすぎですね。 Mercurial には便利な機能があります:
hg clone は SSH 経由で新しいリポジトリを 作れる んです:
$ hg clone . ssh://yourserver/path/to/repos/newrepos
注: ただし、 .hg/hgrc に新しいパスを追加するのは手作業です。