■サーバ側
グループの作成とユーザの追加
/usr/sbin/groupadd sample.project.justoneplanet.info gpasswd -a ishimoto sample.project.justoneplanet.info
プロジェクトディレクトリの作成
mkdir sample.project.justoneplanet.info cd sample.project.justoneplanet.info
リポジトリの作成
git --bare init vi description
リポジトリの概要でも書いておく。書かなかった場合は以下のエラーが出る。
*** Project description file hasn't been set error: hooks/update exited with error code 1 error: hook declined to update refs/heads/master
権限設定
SSHでpushしたりするために以下の操作を行う。
chmod -R 0775 /usr/local/development/repos/sample.project.justoneplanet.info chmod -R g+s /usr/local/development/repos/sample.project.justoneplanet.info chgrp -R sample.project.justoneplanet.info /usr/local/development/repos/sample.project.justoneplanet.info
正しく設定できていない場合、push時に以下のエラーが出る。
error: failed to push some refs to 'ssh://ishimoto@123.123.123.123:1234/usr/local/development/repos/sample.project.justoneplanet.info'
■クライアント側
リポジトリの準備
mkdir sample.project.justoneplanet.info cd sample.project.justoneplanet.info git init
ファイルの追加とコミット
git add . git commit -a -m "first commit"
リモートリポジトリの追加とpush
git remote add origin ssh://ishimoto@123.123.123.123:1234/usr/local/development/repos/sample.project.justoneplanet.info git push origin master
リモートリポジトリの設定を間違えた場合
git remote set-url origin ssh://ishimoto@123.123.123.123:1234/usr/local/development/repos/sample.project.justoneplanet.info