How To Install Git on Ubuntu 18.04 LTS (Linux)

Git is a SCM (Source Control Management System). Git is used in the Management of changes to documents, programs, and other information stored as computer files. Its first usage have been for Linux and for Git itself. It is open source and free. In this post we will see How To Install Git on Ubuntu 18.04 LTS (Linux).

Step 1 # Install git

Confirm Git the installation . run the following command to verify which version of git is installed.

To get help run the following command in command line: (where verb = config, add, commit, etc.)

Step 2 # Set Up and configure Git

After the installation of git it is advisable to do some basic git configuration. This configuration will be helpful when you will commit your code. After this basic git configuration helps to generate the infomation about the person who have commited the code.

By running the following commands you can set these config options in Git.

Quick trick about line endings: Windows: git config --global core.autocrlf true

Mac/Linux: git config --global core.autocrlf input

We can view all the configuration that have been done by providing following commands:

Full Git and GitHub Course –

Basic Git command List –

Creating our first repository and Commit code using git.

Creating our first repository :

you will observe the .git directory is created

Let’s Add a file, make some changes, and run git status

To check the status of git provide the following command

Let’s commit a file into the repo:

Partner Sites