how to run git on Raspberry Pi

From Petr Sladek

Jump to: navigation, search


Todays tutorial will show you how to run a git repository server on your Raspberry Pi.

Why

These are a few pros of making Raspberry Pi into a git repository as this server has a very small footprint and power consuption:

  • very good price: you can get one for $25 or $35
  • no movable parts: no disk, no fans, results in no noise and higher reliability
  • very low power consumption (less than 5 Watts) means very low operation costs
  • huge community support and fan base

Of course, not everything is perfect, so we have to consider a few cons also:

  • limited processing power performance
  • limited data storage space

So this device is perfectly suitable for low cost projects with a few users and a limited data throughput.

How To

In this section you can find the a Step by Step tutorial needed to make Raspberry Pi into a git repository server.

In the beginning, run the classical update/upgrade:

sudo apt-get update
sudo apt-get upgrade

Then install git:

sudo apt-get install git

Init the git repository:

git init --bare <reponame>

The '--bare' flag is here here to the command line argument to make it the server repository, that means not creating the working directory.

Now on your local computer, clone the repository from Pi: git clone pi@<raspiaddress>:/home/slady/<reponame>/

And voila, now you have it, you are done!

Check out other Raspberry Pi tutorials! ;-)

Personal tools