- install packkages
yum install git git-daemon xinetd
- config xinetd and git daemon to pull, push project from localhost
chkconfig xinetd on
vim /etc/xinetd.d/git
disable = no # ← 変更
user = git # ← 変更
server = /usr/bin/git ← 変更
server_args = daemon --base-path=/srv/git --export-all --user-path=public_git --syslog --inetd --verbose --enable=receive-pack # <- 変更
/etc/init.d/xinetd start
- create git user and group
useradd git
groupadd git
- git ユーザーになって /srv/git に移動
sudo /bin/bash
su git
cd /srv/git
- ディレクトリを作成
mkdir hoge
- 作成したディレクトリに移動し、リポジトリを初期化
cd hoge
git init --bare --shared=true
- バックアップ用に /home/git/ に最初にクローンする
cd /home/git/
git clone git://localhost/hoge