How to install, configure and use GIT on an Ubuntu 14.04 LTS VPS

how-to-install-and-set-up-git-on-ubuntu-14-04-lts-vpsIn the following article we are going to explain to you how to install and set-up GIT on an Ubuntu 14.04 VPS.

If you are looking for a full-featured GIT environment, we suggest you check our great article on how to install Gitlab, Ruby and Nginx on a Debian 7 (Wheezy) VPS.

What is GIT?

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Git is easy to learn and has a tiny footprint with lightning fast performance. It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows.


Before installing and setting up GIT, make sure your Ubuntu Linux VPS is fully up to date by using the following commands:

## apt-get update
## apt-get upgrade



The best and fastest way to install GIT on your Ubuntu 14.04 VPS, is to use apt as in:

## apt-get install git-core



Once GIT is installed on your linux server, you may want to configure it using git config or its configuration file .gitconfig, though it is not required as GIT will work with no-configuration by default. Anyway, let’s set-up some GIT parameters using git config:

Set-up Name/Email

## git config --global "My Name"
## git config --global

Set-up Editor

## git config --global core.editor vim

Set-up Diff tool

## git config --global merge.tool vimdiff

Display GIT Configuration

## git config --list

to learn more about git config, refer to its man page.


You can easily create a GIT repository on your linux virtual server using something like this:

## mkdir -p /repos/my-git-project
## cd /repos/my-git-project
## git init --bare



Now, clone the repository you just created, add a sample README file, commit your changes and perform a push request using:

## cd /home
## git clone ssh://
## cd my-git-project
## echo test > README
## git add README
## git commit -m "Initial commit. Adding README file"
## git push origin master



Git status

changed files in your working repository

## git status

Git log

show all git commits

## git log

Git diff

made changes to tracked files

## git diff

Git branch

list all branches

## git branch

try searching the Internet to find out more git usage examples.

Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to install GIT for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.


Install Fail2ban on an Ubuntu 14.04 VPS
How to install SilverStripe CMS with Nginx on a Debian 8 VPS
How to install Backdrop CMS with Nginx on an Ubuntu 16.04 VPS
  • Anil


    Author Reply

    Can you please share same thing wih CentOS 6 VPS. I need to configure GIT in my VPS.

    • admin


      Author Reply

      Hi Anil,

      The git commands are valid for CentOS VPS, except that you need to use yum instead of apt to install git, for example:

      yum install git -y

      and then proceed with git configuration.

      let us know how it goes

  • Fahmy


    Author Reply


    Very clear yet short article. I like it very much :)
    Anyway, this article of your is explaining how to setup Git in local machine, correct?
    May be you can share your experience with setting-up Git remote repository. Have you done it before?