How to Install and Configure Git on Ubuntu 20.04

Git is an open-source and freely available distributed version control system that can manage small to large projects fast and efficiently. It is very easy to use, lightning-fast, and has the best performance. It tracks all the changes made from time to time in a source code of development of software tools. Linus Torvalds in 2005 created Git for the Linux kernel system.

Installing Git from Ubuntu Software APT

It is a recommended method to install the Git system from the Ubuntu Software repository.

Step 1:

As always, first, update and upgrade your APT.

$ sudo apt update

$ sudo apt upgrade

Step 2:

The Git utility package is, by default, included in ubuntu’s software repositories that can be installed via APT. Just enter the following command to download and install Git.

$ sudo apt install git

Git requires root/sudo privileges to be installed so, enter the password to continue the installation.

Step 3:

When Git gets installed, you can check its verification with the following command

$ git –version

Configuring Git

You can configure Git through the terminal/command-line window. It requires a global username that acts as a commit name and an email address.

Step 1:

Enter the following command to set a username, replace the content inside the “Younis said” with your name.

$ git config --global user.name “Younis said”

Step 2:

Enter the following command to set a global user email, replace the content inside the “younis.said@gmail.com” with your user email.

$ git config –global user.email “younis.said@gmail.com”

Step 3:

Lastly, check for the changes you just made by using the following command. It lists out the changes made to the Git configuration file.

$ git config --list

Step 4 (optional):

You can also edit these settings any time for that you have to change it via “git config command” in the terminal window.

$ git config

Conclusion:

Git is very easy to install on Ubuntu, just needs 4 commands to install and configure it. You just need an APT command to download and install the stable version from the Ubuntu repository



from Linux Hint https://ift.tt/3cXYCr7

Post a Comment

0 Comments