http://tumblr.intranation.com/post/766290565/how-set-up-your-own-private-git-server-linux
sudo adduser git
sudo mkdir /home/git/.ssh
sudo cp ~/.ssh/authorized_keys /home/git/.ssh/
sudo chown -R git:git /home/git/.ssh
sudo chmod 700 /home/git/.ssh
sudo chmod 600 /home/git/.ssh/*
# you should be able to ssh into the server as git without a password:
ssh git@servername
# as user git:
su - git
mkdir Git
cd Git
Create an empty git repository to upload files to:
mkdir myrepo.git
cd myrepo.git
git --bare init
git remote add origin git@science.cloud5.harker.com:[reponame].git
git config branch.master.remote origin
git config branch.master.merge refs/heads/master
git symbolic-ref -m "linking HEAD to master" HEAD refs/heads/master
git push origin master
git remote show origin
#git branch science
#git push origin master
#git push origin science
#git status
#git remote show origin
# Grant anonymous http access to the git repo
<VirtualHost *:80>
ServerName git.gitserver
DocumentRoot /opt/git
<Directory /opt/git/>
Order allow, deny
allow from all
</Directory>
</VirtualHost>