How to Install Git on Ubuntu 18.04

How to Install Git on Ubuntu 18.04

You might have heard about Git, It is one of the most popular tools used as for distributed version control system(VCS). Git is mainly used for source code management (SCM) and has become most widly used system for version control.

Installing Git on Ubuntu 18.04 LTS

First of all we need to launch terminal by goint to application menu and selecting terminal or using the shortcut “Ctrl+Alt+T”

Now we will run general OS update command

sudo apt-get update

Once the above command is executed you are ready to install git on ubuntu 18.04 LTS

1.Installing Git

apt-get install git-core

Now you will be asked for confirmation to install certain files and size of the files will be mentioned there. Simply press “Y” or “y” and press enter or return key

2.Confirm if Git is installed successfully

One the installation of git is done, It is pretty easy to test if its installed successfully by just typing the command below.

git –version

The above command will display the latest version of Git installed on your Ubuntu 18.04 LTS.

3.Now configure setting for the Git user

Its best practice to setup the Git user just after installation to avoid any kind of error in future. To set the user you need to use following commands

git config –global user.name “username”
git config –global user.email “[email protected]

In the above command “username” is the name of user, It can contain spaces as well. “[email protected]” refers to the email address of the user.

Something to keep in mind that git user configuration works user by user basis, what that means is if you have multiple accounts on your Linux system say A and B, User ‘A’ should run the config for user ‘A’ and user ‘B’ should run the same command for user ‘B’.

Now once we are done with all these, lets move to next step

4.View or verify the configuration changes done on the last step

Git command to view the configuration is

git config –list

or

View the configuration file using cat command

cat ~/.gitconfig

That’s the process to install, configure and verify the installation of git on Ubuntu 18.04 LTS. You can follow the steps and achieve the same results.