As much as I am a fan of the githubs, if you only intend to host your private git repositories, you don’t need to pay them a monthly fee as long as you have SSH access to a server.
Here’s how:
Make sure you’ve initialized your project first:
git init && git add . && git commit -m 'my first commit'
Copy the .git directory over to the server:
scp -rp .git bryan@yourserver.com://path/to/repositories/myproject.git
Add the remote to your git config:
git remote add myremote ssh://server.com/path/to/repositories/myproject.git
And that’s all! You can now push your commits to your new remote:
git push myremote
This is a simple and quick solution for an individual developer looking to backup or make a project accessible from anywhere.
If anyone knows of a cool web interface for git that can work with this, leave a comment.
This should also work on small teams as long as you setup proper group permissions and umasks for the accounts on the server. That very well could be my next post ….