LoginSignup
4
3

More than 5 years have passed since last update.

【覚書】2〜3名でちょっとした資料を管理したいときのGit Repoの作り方

Posted at
/bin/sh
# groupadd gitusers # 適当なグループ作成
# usermod -G gitusers user_account # 対象のuser全員をgroupに追加
# mkdir /path/to/project.git
# chgrp -R gitusers /path/to/project.git
# cd /path/to/project.git
# git --bare init --shared

$ git clone ssh://host/path/to/project.git # ssh login出来る人だけアクセス可能

ref: http://nksg.org/archives/109
もし、--sharedを付け忘れたり、groupの書き込み権限付与に失敗して、rwできない場合は以下

/bin/sh
# chgrp -R gitusers /path/to/project.git
# cd /path/to/project.git
# git config core.sharedRepository group
# chmod -R g+w HEAD
# chmod -R g+w config
# chmod -R g+w description
# chmod -R g+ws hooks
# chmod -R g+ws info
# chmod -R g+ws objects
# chmod -R g+ws refs

ref: http://d.hatena.ne.jp/kuma8/20110115/1295100616

MAC OS上にshared repo作るときは、

  1. システム環境設定→ユーザとグループ
  2. +ボタンを押して、ユーザとグループを必要に応じて作成
  3. 作成したグループを選択し、メンバーを追加(チェックボックス)
    (コマンドラインでは、dsclというコマンドがあるにはあるがGUIからやった方が無難)
    ref: http://d.hatena.ne.jp/ksaito11/20110508/1304756757
  4. システム環境設定→共有
  5. リモートログインを選択し、許可するユーザをチェック
    ここで許可されたユーザだけsshできるようになる
  6. 後は、同じようにgit shared repoを作る

以上

4
3
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
4
3