From eb7ee6a3daea11e94dd6395ab22d5097401841ae Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Wed, 10 Aug 2022 02:40:06 +0300 Subject: [PATCH] Add a script `sharedRepoGroup` --- sharedRepoGroup | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 sharedRepoGroup diff --git a/sharedRepoGroup b/sharedRepoGroup new file mode 100755 index 0000000..3221540 --- /dev/null +++ b/sharedRepoGroup @@ -0,0 +1,18 @@ +#! /bin/sh +# See https://stackoverflow.com/a/69193032/7976758 + +set -e +git config core.sharedRepository group + +# Fix group +chgrp -R $1 . # Use desired group name + +# Fix file/directory permissions throughout the entire tree +chmod -R ug+rwX . # Please note **uppercase** X + +# Make FS to inherit group on creating subdirectories or files +find . -type d -exec chmod g+s '{}' \+ + +# Git object DB files are read-only +find .git/objects -type f -exec chmod ug=r '{}' \+ + -- 2.39.5