Skip to the content.

Git Server (SSH Protocal)

Local Machine

Export Bare Repository

mkdir <project>.git
cd <project>.git
git init --bare

git clone --bare <project-dir> <git-repo>.git

Put Bare Repository on Server

scp -r <git-repo>.git <user>@<git-server>:/<path-to-git-repo>

Server

Recipe

sudo adduer git
sudo passwd git
sudo chown git:git  /<path-to-git-repo>
sudo adduser <user>
sudo passwd <user>
gpasswd -a <user> git

References