Tuesday, December 18, 2012

Worlds Cheapest Git Server Pt. 2


Here it is!  To install git, run "apt-get install git" (while online of course, which for me meant hooking up ethernet cables and a television at the local library).  "Wheezy" is the raspberry pi ported version of Debian, which has ssh pre-installed (although with strange defaults that I haven't worked through - it doesn't quite do keyphrases as expected right now).

Wheezy also comes with Scratch (an educational programming system for children) - worth checking out.

After setting up accounts, permissions and repositories, and Git Extensions on my Windows machine, and git-scm for Mac http://git-scm.com/download/mac, and turning on meta-files in Unity and following the other Unity documentation, it works!  Hurray!

[Somewhere in the process git asked if I wanted Windows-Unix line-terminator conversions, which I answered "no conversion" and that seems to work fine so far.]

Also, not only does it work - it works well.  There's some latency when checking out a 500MB repository for the first time, but it isn't bad.  I will have to put some mileage to see about making minor code changes and checkin/checkout waits.

The other downside - if the house burns down, so does the git server!  So it's either make a fire-proof housing for the server, or store it off-site when not in use.



Total cost:
Raspberry pi (Newark): $35
(but look at my previous post and you might get a better coupon price before January 30th or so)

Power Supply (Newark): $7

Newark shipping: $10

SanDisk 32GB SD-card (Newegg): $35 + free shipping
http://www.newegg.com/Product/Product.aspx?Item=9SIA12K0AT5024

Total: $52


Optional (really could have lived without this, since can use any t.v. screen, and after ifconfig to get IP address, just ssh remotely for setting up):

HDMI to DVI cable (Newegg): $7 + free shipping
http://www.newegg.com/Product/Product.aspx?Item=N82E16812576006






Also - to do a git push, you have to set up a git bare repository on the server.  Something like this:

pi@raspberry ~ mkdir myRepoDir

pi@raspberry ~ cd myRepoDir

pi@raspberry ~ git init --bare

Now from your client you can push to ssh://pi@192.168.0.100/~/myRepoDir (or whatever the IP of the raspberry is), and the repository is set up.  Now any other machine can pull from ssh://pi@192.168.0.100/~/myRepoDir.