How to install Git 2.15.1 on Ubuntu 18.04

How to install Git 2.15.1 on Ubuntu 18.04

Git is open source and free version control software. It is a distributed system and used to manage a project, or a set of files, as they can change over time. It stores this information in a data structure which we call a repository.

It comes with built-in GUI tools. It is an excellent software to track changes in the repository files and coordinate work among several people working on the same project. It is primarily used for source code management in software development.

Step 1: Install Git

Git is placed at its standard repository. We will install it from there using the following command

$ sudo apt -y install git

Now check the Git version to make sure you have installed it correctly without any error.

$ git --version

git version 2.15.1

Step 2: Git configuration

Now you can now use git commands to clone any repository as you wish. However, if you need to make git commits you first need to set your personal information. It will be submitted to the main branch. Whenever you will make a commit, your information will be submitted along with it.

It is useful when you need others to know that you made a commit to the repository. To do so, you need to enter the following Linux commands to set your name and email address.

$ git config --global user.name "Tom"

$ git config --global user.email tom@gmail.com

Every participant will set this information so that when tracking the information, it will be easy to identify the committer.

At any time if you wish to change the personal information setting, you can do by editing the main git configuration file located within your home directory. The file is ~/.gitconfig.

[user]
        name = Tyler
        email = tyler@gmail.com

Step 3: Initializing a repository

If you have a project that is not under version control, then you have to make it a Git repository. To make it Git controllable, you will need to go to the project directory and execute git command. The following command will take you to your project.

$ cd /home/user/my_project

Next, write the command to make it a Git repository.

$ git init

Step 4: Cloning an existing repository

You can clone an existing Git repository to your local machine to contribute in software versioning.

Git receives a full copy of all the data that the server has. Versions of every file for the history of the project is pulled down by default when you run git clone command. In fact, if your server drive gets corrupted, you can often use nearly any of the clones on any client to set the server back to the state it was in when it was cloned.

You clone a repository with the command git clone <url>. For example, if you want to clone the Git linkable repository called adminmodule, the following command will do so.

$ git clone https://github.com/adminmodule/adminmodule

Conclusion

Git can be easily installed directly from its standard library. It is free and open source software. Its installation is very quick and with minimal effort, you will get it working. This software is able to configure your details for Git commits to help you track your changes. It can configure a project as a repository from scratch or, you can clone an existing Git repository on your system to participate in your project.

Check out these top 3 Linux hosting services

FastComet
$1.79 /mo
Starting price
Visit FastComet
Rating based on expert review
  • User Friendly
    4.7
  • Support
    5.0
  • Features
    4.8
  • Reliability
    4.5
  • Pricing
    5.0
HostArmada
$2.49 /mo
Starting price
Visit HostArmada
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.0
Hostinger
$2.99 /mo
Starting price
Visit Hostinger
Rating based on expert review
  • User Friendly
    4.7
  • Support
    4.7
  • Features
    4.8
  • Reliability
    4.8
  • Pricing
    4.7

How to Create a Non-root User on Your Ubuntu 18.04 VPS or Dedicated Server

This guide shows you how to create a user on your Ubuntu 18.04 virtual server.
3 min read
Michael Levanduski
Michael Levanduski
Expert Hosting Writer & Tester

How to Install a Self-Signed SSL Certificate on Your Ubuntu 18.04 VPS or Dedicated Server

This how-to article will teach you how to create a self-signed SSL certificate o
3 min read
Michael Levanduski
Michael Levanduski
Expert Hosting Writer & Tester

How to Set Up Cron Jobs on Your Ubuntu 18.04 Dedicated Server or VPS

This guide shows webmasters and administrators how to set up cron jobs on your U
3 min read
Idan Cohen
Idan Cohen
Marketing Expert

How to Install WordPress on Your Ubuntu 22.04 VPS or Dedicated Server

This tutorial will show you how to install WordPress on your Ubuntu 22.04 virtua
3 min read
Idan Cohen
Idan Cohen
Marketing Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top