Can I get Git on Raspbian to back-up my C/C++ files?
Do I need to download anything to use Git on my Raspberry Pi?
Where can I learn to use it?
Can I get Git on Raspbian to back-up my C/C++ files?
Do I need to download anything to use Git on my Raspberry Pi?
Where can I learn to use it?
You may use:
$ sudo apt-get install git
to install Git and then read the Pro Git book (by Scott Chacon and Ben Straub) about how to use it.
Like what Lenik said, install Git using:
sudo apt-get install git
To back-up your C/C++ files, I suggest creating a free account on the popular GitHub. After registration, they provide a newbie-friendly guide on how to configure and use Git to upload code into repositories. The only downside using this method is your code will become public unless you pay for a private repository.
Yes, you can install Git with sudo apt-get install git
. In fact, I think it is already installed on some versions.
You'll need to configure it with
git config --global user.name "Your Name"
git config --global user.email [email protected]
The Pro Git book can teach you how to use it, or try the tutorials on raspberrypi.org or Adafruit. GitHub also has some tutorials on there.
I have successfully installed Git on my Raspberry Pi recently and created a repository. I am now having some problems pushing it to GitHub but I know some people have done it successfully.
It's probably a good idea to put your code on GitHub or BitBucket. BitBucket gives you unlimited private repositories for free, but GitHub is still the most popular.
Getting Started With Git
I fired it up recently and git was already installed. Might want to check that first.
git --version
The posts in this thread were correct when it was started in July of 2013. But it's now 2018, and some of the information in this thread is no longer correct. Specifically, git
is no longer installed by default on Raspbian. For example, git
is not installed by default on Raspbian Stretch Lite.
That said, the sequence for installing git
is:
df -h
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install git
sudo apt-get clean
The first command (df -h
) will give you a chance to make sure you've got space on your "drive" for the installation. This is important as apt
doesn't verify this before it starts! The last command (sudo apt-get clean
) will "take out the trash", and help conserve space on your "drive".
Or if you want to make your Raspberry Pi a local Git Repository Server - you could do it with Git Lab https://about.gitlab.com/2015/04/21/gitlab-on-raspberry-pi-2/
It should be inside the repository for Debian, and probably others like Pidora would have it too.
Try:
sudo apt-get install git
That should work.