= gitサーバのセットアップ = ここではgitプロトコルでのみアクセスすることを考える。対象はCentOS 6.5。 == git,git-daemonのインストールと設定 == {{{ yum install git git-daemon }}} git-daemonはxinetdから起動されるようになっている。/etc/xinetd.d/gitを変更。 {{{ # default: off # description: The git damon allows git repositories to be exported using \ # the git:// protocol. service git { disable = yes socket_type = stream wait = no user = nobody server = /usr/libexec/git-core/git-daemon server_args = --base-path=/var/lib/git --export-all --user-path=public_git --syslog --inetd --verbose log_on_failure += USERID } }}} disable = noとして起動できるようにする。 「--base-path=/var/lib/git」を削除する。これがあると、このディレクトリ以外のリポジトリにはアクセスできず、その場合clone時に「The remote end hung up unexpectedly.」という訳のわからないエラーが出る。 「--enable=receive-pack」を追加する。これが無いとpushできないと言われてしまう。 {{{ service xinetd restart }}} === リポジトリの設置とclone === /var/gitディレクトリを作成し、そこに以前作成したリポジトリを置く。/var/git/abc.gitとする。 これをcloneしてみる。 {{{ git clone git://localhost/var/git/abc.git }}}