<< htmlのcharsetとソースの文字コードを比較してチェックするスクリプト | main | 続・はやりのgitをインストールした。そして使ってみた。 >>

はやりのgitをインストールした。そして使おうとしてみた。

このエントリーを含むはてなブックマーク hateb
まずはインストールだ。MacPortsにあるのならそれを利用したい。ということで、とりあえず探してみることに。
$ port search git
cogito devel/cogito 0.18.2 Git core and cogito tools to provide a fully-distributed SCM
git-core devel/git-core 1.5.3.7 The stupid content tracker.
stgit devel/stgit 0.14.1 Push/pop utility on top of GIT
cgit www/cgit 0.7.1 A fast web interface for the git source code management system
おお、いい感じの結果だ。サマリーから想像するに、git-coreとcogitoだろう。(cgitなんかもちょっと気になるけど。)
で、インストールの前に使えるvariantsを確認する。
$ port variants git-core
git-core has the variants:
universal
doc: Install HTML and plaintext documentation
svn: Bi-directional subversion repository support
ふむふむ。svnってのは要チェックだな。
$ port variants cogito
cogito has the variants:
universal
こっちは何も無いか。じゃ、早速インストールだ。
$ sudo port install git-core +svn
$ sudo port install cogito
(中略)
Error: port activate failed: Image error: /opt/local/lib/perl5/5.8.8/darwin-
2level/perllocal.pod is being used by the active ImageMagic port. Please
deactivate this port first, or use the -f flag to force the activation.
ありゃ、エラーがでるよ。
よくわかんないけど、ImageMagickが邪魔してるみたいだ。最近はあまり使っていないからいったんdeactivateしちゃおっか。
$ sudo port deactivate ImageMagick
で、もう一度。
$ sudo port install git-core +svn
$ sudo port install cogito
これでインストール。完了。
ちょっと気になるImageMagickをもう一度activateしてみよう。
$ sudo port activate ImageMagick
---> Activating ImageMagick
Error: port activate failed: Image error: /opt/local/lib/perl5/5.8.8/darwin-
2level/perllocal.pod is being used by the active git-core port. Please
deactivate this port first, or use the -f flag to force the activation.
ああ、やっぱだめだ。仕方が無いので、無理矢理activateすることに(force)。
$ sudo port activate -f ImageMagick
---> Activating ImageMagick
Warning: File /opt/local/lib/perl5/5.8.8/darwin-2level/perllocal.pod
already exists. Moving to: /opt/local/lib/perl5/5.8.8/darwin-
2level/perllocal.pod.mp_1203443185.
OK.
じゃ、早速gitを使ってみよう。
作業フローはこちらが超参考になる。

unknownplace.org | # 2008-02-19 | git-svn 作業フロー

ここと同じようにplaggerレポジトリに対して行ったところうまくいった。ただ、僕はPlaggerのコミッタというわけではないので、自分のレポジトリに対して使ってみることにする。「自分の」と言ってもCodeReposだけど。

$ cd ~/Work/
$ mkdir -p coderepos
$ cd coderepos/
$ git svn init -s http://svn.coderepos.org/share/ share
$ cd share
$ git svn fetch
これは最後のfetchがうまくいかない。
いろいろ調べてみるとレポジトリにbranchesというディレクトリが切られていないとだめらしい。
(本当か?どこで見たのか、出典を探したけど見つからなかった。ごめんなさい。)

そこで、自分が管理しているモジュールのディレクトリに対して行ってみた。ここはtrunk,branches,tagsという一般的なsvnのレポジトリディレクトリ構成になっているから。
/share/lang/perl/Games-Go/trunk
/share/lang/perl/Games-Go/branches
/share/lang/perl/Games-Go/tags
こんな感じで。

$ cd ~/Work/
$ rm -rf coderepos
$ mkdir -p coderepos/share/lang/perl/
$ cd coderepos/share/lang/perl
$ git svn init -s http://svn.coderepos.org/share/lang/perl/Games-Go/ Games-Go
$ git svn fetch
よし。うまくfetchできたよ。
なんか、途中でNoticeみたいなのが出力されていたけど、まあ、それは無視...
で、続いてcheckoutだ。
$ git checkout trunk
(中略)
GIT_SVN_ID may be set in the environment or via the --id/-i switch to an
arbitrary identifier if you're tracking multiple SVN branches/repositories in
one git repository and want to keep them separate. See git-svn(1) for more
information.
ありゃりゃ。こんなエラーが。
えっと、ひとつのgitレポジトリの中に複数のbranchesやrepositoriesがある場合は、もうちょいとマニュアルを読めとな。
うーん。とりあえずいまはここまで。

こちらのマニュアルを読もうと思う。
Git ユーザマニュアル (バージョン 1.5.3 以降用)

CodeReposでgit使いたい!

2008/02/21 追記
問題一部解決編を書いた。
続・はやりのgitをインストールした。そして使ってみた。

| Web技術 | 09:49 | comments(0) | trackbacks(1)
この記事のトラックバックURL
http://en.yummy.stripper.jp/trackback/825692
トラックバック
続・はやりのgitをインストールした。そして使ってみた。
このエントリーは「はやりのgitをインストールした。そして使おうとしてみた。」の続きだよ。 前回の問題点が解決されて、CodeReposでgitを使う手順がまとまった(インストールまでは前回のエントリを参照のこと)。 こないだのエントリーを見たtypesterさんからtwitt
| ブログが続かないわけ | 2008/02/21 12:03 PM |
コメント
コメントする