Sharing git on a private network

If you want to share your git repos using the git protocol you can use the following

git-daemon --syslog --base-path=/home/rob/src --export-all --detach

This starts the git daemon in the background

rob@rob-laptop:~/src/hosting_admin$ netstat -ltanup | grep git
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:9418            0.0.0.0:*               LISTEN      19583/git-daemon
tcp6       0      0 :::9418                 :::*                    LISTEN      19583/git-daemo

It should then be a question of pulling from the remote location like so.

git pull git://192.168.1.120/repository

This doesn’t provide any security out of the box, so I wouldn’t recommend using this out in the wild but on a private network amongst your team this is an easy way to share your repo.