Skip to content

Instantly share code, notes, and snippets.

@nishinoshake
Last active July 27, 2016 13:31
Show Gist options
  • Save nishinoshake/1816893ad6a46d6fb73096de3a608988 to your computer and use it in GitHub Desktop.
Save nishinoshake/1816893ad6a46d6fb73096de3a608988 to your computer and use it in GitHub Desktop.
リモートリポジトリの作成

SSHユーザをgit制限シェルで作成

adduser git-hoge -s /usr/bin/git-shell
passwd git-hoge

ベアリポジトリの作成

mkdir /var/www/git/hoge.git
cd /var/www/git/hoge.git
git init --bare --shared

gitユーザのみの読み書きに権限を変更

chown -R git-hoge:git-hoge /var/www/git/hoge.git
chmod -R a=rX,g+w  /var/www/git/hoge.git

ただしルート権限がある場合に限る

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment