On Ubuntu20 Python 2!!
https://github.com/tv42/gitosis/blob/master/README.rst https://www.howtoforge.com/setting-up-gitosis-on-ubuntu
apt install -y python-setuptools
git clone https://github.com/tv42/gitosis.git
cd gitosis
sudo python2 setup.py install
sudo adduser \
--system \
--shell /bin/sh \
--gecos 'git version control' \
--group \
--disabled-password \
--home /srv/example.com/git \
git
ssh-keygen -b 4096
sudo -H -u git gitosis-init < .ssh/id_rsa.pub
sudo chmod 755 /srv/example.com/git/repositories/gitosis-admin.git//hooks/post-update
client side
git clone git@serverdomain:gitosis-admin.git
Put pubkey to gitosis-admin/keydir
vim keydir/foo.pub
edit gitosis.conf. add the foo user.
[group gitosis-admin]
members = youruser@serverdomain.com foo
writable = gitosis-admin
caution: keyname foo.pub
and user foo
same.
Then, foo user can clone gitosis-admin
config .ssh/config
Host serverdomain.com
user git
identityFile ~/.ssh/id_foo
git clone serverdomain.com:gitosis-admin.git
https://ssteiner.wordpress.com/2009/05/13/adding-a-new-repository-under-gitosis-2/
[group exampleproject]
members = foo
writable = myproject
git commit -a -m "Added new group 'exampleproject' and project 'myproject'"
git add gitosis.conf
gitosis-admin$ git commit -m “add new group”
git pushmkdir myproject
cd myproject
git init
echo "sample file!!" > sample.txt
git add sample.txt
git commit -a -m "First commit"
git remote add origin foo@yourserver.com:myproject.git
git push origin master
[group testgroup]
writable = testproject
members = @groupname