LoginSignup
6
5

More than 5 years have passed since last update.

Gitサーバ構築

Last updated at Posted at 2016-01-07
  • 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
6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5