How To Install Git on Ubuntu 12.04

What the Red Means

The lines that the user needs to enter or customize will be in red in this tutorial! The rest should mostly be copy-and-pastable.

About Git

Git is a distributed version control system released to the public in 2005. The program allows for non-linear development of projects, and can handle large amounts of data effectively by storing it on the local server. This tutorial will cover two ways to install Git.

How to Install Git with Apt-Get

Installing Git with apt-get is a quick and easy process. The program installs on the virtual private server with one command:

sudo apt-get install git-core

After it finishes downloading, you will have Git installed and ready to use.

How to Install Git from Source

If you are eager to download the most recent version of Git, it is generally a good idea to install it from the source.

Quickly run apt-get update to make sure that you download the most recent packages to your VPS.

sudo apt-get update

Prior to installing Git itself, download all of the required dependancies:

If you avoid putting in your username and email, git will later attempt to fill it in for you, and you may end up with a message like this:

[master 0d9d21d] initial project version
Committer: root
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email you@example.com
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author

See More

This tutorial covered how to install Git on your virtual private server. Stay tuned for a second tutorial on Git Basics.