How to configure an existing git repo to be shared by a UNIX group

后端 未结 5 1555
借酒劲吻你
借酒劲吻你 2020-11-28 18:02

I have an existing git repo (a bare one) which has up to this point only been writable by me. I want to open it up to some UNIX user group, foo, so that all members of foo

5条回答
  •  攒了一身酷
    2020-11-28 18:49

    Try this to make an existing repository in repodir work for users in group foo:

    chgrp -R foo repodir                 # set the group
    chmod -R g+rw repodir                # allow the group to read/write
    chmod g+s `find repodir -type d`     # new files get group id of directory
    git init --bare --shared=all repodir # sets some important variables in repodir/config ("core.sharedRepository=2" and "receive.denyNonFastforwards=true")
    

提交回复
热议问题