File ownership/group is changed when users push to a GIT repository

后端 未结 1 925
北恋
北恋 2020-12-31 06:45

For over a year, I\'ve been having troubles with GIT and directory/file permissions. I have a central repository to which multiple developers push code, using ssh (origin se

1条回答
  •  别那么骄傲
    2020-12-31 07:18

    It looks like you changed the core.sharedRepository after initializing the repository rather than using init --shared=group which should set the permissions up correctly. This means that the sgid bit won't be set on the git repository's directories correctly. You will have to fix this manually with something like (assuming GNU find and xargs):

    find . -print0 | xargs -0 chgrp group_name
    
    find . -type d -print0 | xargs -0 chmod g+s
    

    0 讨论(0)
提交回复
热议问题