Another milestone in my Git Conversion Project. Setting up a shared git repository on a server.
In this example my server filesystem layout was pretty basic. I created a git system user and made its home /data/share/git, then made sure all my developer users were in the local git group.
If you’ve got an existing repository, create a bare clone.
git clone --bare lemboscripts lemboscripts.git
Then copy to server.
scp -r lemboscripts.git server1:/data/share/git/
Get on server and re-initialize as shared bare repository.
git init --bare --shared
The “–shared” switch sets permissions so that anyone in the same local group as git can write to that directory.
Finally, go back to client(s) and clone from server (making sure that any existing “lemboscripts” folder has been renamed to say, “lemboscripts.bak”).
git clone server1:/data/share/git/lemboscripts.git
This new clone of the repository (with working directory) will then appear as lemboscripts.
 Did a “groupadd -g 1011 git” and then “useradd -g git -u 1011 -c ‘Git User’ -d /data/share/git git”.
 A bare clone is a copy of the repository without the working directory (where you work on the files). It will look as if you did a “cp -R lemboscripts/.git/* lemboscripts.git/”.
 For good measure I did a “chown -R git:git” and “chmod -R g+w” against git’s home, and made sure all the dot bash files were in place.
 On my workstation I performed the cloning operation under a new $HOME/git directory, and so wound up with “$HOME/git/lemboscripts”.