- repo name can be anything (but usually they end in .git)
for synology NAS diskstations, you probably want your git repos under /volume1
$ ssh <user>@<server>
$ cd /srv/git
$ mkdir <repo>
- make sure that the users group has write access.
$ chgrp users <repo>
$ chmod g+sw <repo>
- initialize the bare repo with shared permissions:
$ cd <repo>
$ git init --bare --shared=group
note: this is not a working copy, only a master repo. you can't add files to this. to push data from a local working copy, set up the repo on your local workstation and push to the server.
- create local clone of repo
$ git clone <server>:/srv/git/<repo>
$ echo "this is a test" > foo.txt
$ git add foo.txt
$ git commit -a -m "initial commit"
$ git push origin master
- for read-only access using git user:
https://www.linux.com/learn/how-run-your-own-git-server
$ git clone git@<server>:/srv/git/<repo>