Install Git on Linux/Ubuntu

Install Git on Linux/Ubuntu

Overview
Git is a free and open source distributed version control system with an emphasis on speed, data integrity, and support for distributed, non-linear workflows.

Installation
Use command line below to update local package index and then install the packages:

1
2
sudo apt-get update
sudo apt-get install build-essential libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip

Setting Up Git
Now you have git installed, you need to do a few things so that the commit messages that will be generated for you will contain your correct information.

You need to provide your name and email address by using git config because git embeds this information into each commit you do. You can go ahead and add this information by typing:

1
2
git config --global user.name "Your Name"
git config --global user.email "youremail@domain.com"

You can see all of the configuration items that you have been set by typing command below:

1
git config --list

What you will see:

1
2
user.name=Your Name
user.email=youremail@domain.com

The information is stored in the configuration file, which you can optionally edit by hand with your text editor like this:

1
vim ~/.gitconfig
1
2
3
[user]
  name = Your Name
  email = youremail@domain.com

So far so good, now you should have git installed and ready to use on your system. To learn more about how to use Git, check out these: www.try.github.io