2010-02-27
Gitサーバ(git-daemon)をMacに構築
ローカルでGitサーバを構築して
$ git clone git://localhost/sample
のようにgit://にアクセスできるように git-daemon を動かしてみました。
1. gitをインストール
MacPortsを使ってgitをインストールします。もれなくgit-daemonも"/opt/local/libexec/git-core/"にインストールされます。
$ sudo port install git-core
2. 公開用のレポジトリ作成
$ mkdir test $ cd test/ $ git init --bare $ touch git-daemon-export-ok
3. git-daemonを起動
$ /opt/local/libexec/git-core/git-daemon --verbose --export-all --enable=receive-pack --base-path=/Users/watson/git/
4. 動作確認
$ git clone git://192.168.1.10/test $ cd test $ echo "test" > test.txt $ git add . $ git commit -m "Initial commit." $ git push git://192.168.1.10/test master Counting objects: 3, done. Writing objects: 100% (3/3), 218 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To git://192.168.1.10/test * [new branch] master -> master
トラックバック - http://d.hatena.ne.jp/Watson/20100227/1267265936
