2 # See https://stackoverflow.com/a/69193032/7976758
7 while getopts agh opt; do
14 shift `expr $OPTIND - 1`
16 if [ $# -gt 1 -o "$1" = -h ]; then
17 echo "Usage: $0 [-a|-g] [group]"
23 git config core.sharedRepository $share
27 chgrp -R $1 . # Use desired group name
28 # Make FS to inherit group on creating subdirectories or files
29 find . -type d -exec chmod g+s '{}' \+
32 # Fix file/directory permissions throughout the entire tree
33 if [ $share = all ]; then
34 chmod -R ug=rwX,o=rX . # Please note **uppercase** X
35 # Git object DB files are read-only
36 find .git/objects -type f -exec chmod a=r '{}' \+
39 find .git/objects -type f -exec chmod ug=r '{}' \+