Git Client for Raspberry Pi
Tinkerer: Lory Livezey
GitHub is a repository for open source software and libraries that allows people to share their code, as well as a way to keep track of changes that happen, a process called <code class="language-bash">source control</code>. The Raspberry Pi can act as both a client (can download from these repositories) as well as a server (store repositories that others can download). In this tutorial, we'll learn how to set up both.
If you are using Windows, refer to this tutorial:
If you use a Mac, you can download Git for Mac here:
What you will need
Installing Git on Raspberry Pi
Installing Git on the Raspberry Pi is easy:
sudo apt-get install git
Once installed, test it by getting the version:
If you get a git version, you're good to go!
Clone a Library
You may have used open source libraries on GitHub, and noticed there are two options. You can download the Zip file or you can
clone it to a directory on your computer:
Copy the link to your clipboard, then remote into your Raspberry Pi using
VNC. Make sure you're in a directory where you want to clone the library, such
Run this command:
git clone https://github.com/adafruit/Adafruit_Python_GPIO.git
When you type
ls again, you'll find the new cloned directory:
Install the Library
There are often other tasks you'll need to do in order to make the library work. You'll usually find instructions on the GitHub page. For instance, the Adafruit Library that we cloned above instructs you to install some other libraries and then run the install program in the cloned directory.
There will be many examples of using Git Client on the Raspberry Pi in the upcoming tutorials. This was just to make sure that you're all wired up and ready to do that!
The Raspberry Pi can also be used as a
Git Server. So it can hold a copy of your (or others') respositories that you can store locally and install them when you need them. Join me for that and other tutorials about the Raspberry Pi.