Technoracle
    Facebook Twitter Instagram
    Facebook Twitter Instagram
    TechnoracleTechnoracle
    • Home
    • AWS
      • EC2
      • Lightsail
      • RDS
      • S3
    • Ubuntu
      • Ubuntu 20.04
      • Ubuntu 22.04
    • AI Tools
    • Web Hosting
    • WordPress
    • Tech News
    Technoracle
    Home»Ubuntu»How to Install Git on Ubuntu 20.04 Easily
    Ubuntu

    How to Install Git on Ubuntu 20.04 Easily

    Rajesh ShivamBy Rajesh ShivamMarch 23, 2022Updated:May 18, 2022No Comments3 Mins Read
    How to Install Git on Ubuntu

    Git is the most popular open-source distributed version control system. It allows you to keep track of your code changes, revert to previous stages, create branches, and collaborate with your co-developers. Git is compatible with all modern operating systems. In this tutorial, you will learn how to install git on Ubuntu 20.04.

    Before installation, you can check the system, whether git is installed or not by the following command.

    $ git --version

    Page Contents

    • How to Install Git on Ubuntu 20.04
      • Install Git with Default Packages
      • Install Git from the Sources
    • Git Basic Configuration
    • Conclusion

    How to Install Git on Ubuntu 20.04

    Git can be installed in two ways

    • Install Git with Default Packages.
    • Install Git from the Sources.

    Install Git with Default Packages

    The easiest and recommended way to install git on Ubuntu is from the packages manager using apt command. Before installation of any application on Ubuntu, it is always recommended to update the default packages. To update the default packages, run the following command.

    $ sudo apt update

    Once the update is completed, you can install git by following command.

    $ sudo apt install git

    Now, verify the installation by checking the version of the git.

    $ git --version

    Output:

    shivam5th@FrankeinstienRig:~$ git --version
    git version 2.32.0

    Install Git from the Sources

    You can alternatively install the latest version from the sources. To install git from the sources, you have to update some library packages first.

    $ sudo apt update
    $ sudo apt install make libssl-dev libghc-zlib-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip

    Once the package installation is completed, open the git projects repository on the browser.

    https://github.com/git/git

    How to Install Git on Ubuntu

    Copy the tar.gz file download link by right clicking on tar.gz as highlighted above. Use wget command to download the file.

    $ wget https://github.com/git/git/archive/refs/tags/v2.32.0.tar.gz -O git.tar.gz

    Above command will download the git file and rename it to git.tar.gz. Now, to extract the .tar.gz file run below command.

    $ tar -zxf git.tar.gz

    Above command will download the git file and rename it to git.tar.gz. Now, to extract the .tar.gz file run below command.

    $ tar -zxf git.tar.gz

    Next, move to the git directory

    $ cd git-*

    Install the packages by running the following commands.

    $ make prefix=/usr/local all
    $ sudo make prefix=/usr/local install

    After installation checks the git version by the following command.

    $ git --version

    Hurray, you have successfully installed the latest version of git.

    Git Basic Configuration

    Before using git, you need to configure with basic details, so that your generated commit message will have your details. To configure the git, run the git config command. You need to add your NAME and EMAIL to the git configuration by the following command.

    $ git config --global user.name "Your Name"
    $ git config --global user.email "youremail@domain.com"

    You can check your configuration by following command.

    $ git config --list

    You can edit the information also by editing the file.

    $ sudo vi ~/.gitconfig

    Conclusion

    In this tutorial, you have learned how to install git on Ubuntu 20.04. If you have any doubts feel free to contact me, I will definitely try to help you. Also, you can join our elite facebook group to get direct help from me. If you like this tutorial, please share this article on your social media handle.

    git install ubuntu
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit
    Previous ArticleHow to Install Tig on Ubuntu 20.04 Easily
    Next Article How to Install Let’s Encrypt SSL on Ubuntu 20.04
    Rajesh Shivam

    Rajesh Shivam is a seasoned professional with expertise in AWS and Linux System Administration. With over 10 years of freelancing experience, he brings a wealth of knowledge to the table. Rajesh has a strong passion for technology and stays connected with the latest happenings in the field. His dedication and expertise make him a trusted resource for all things tech-related.

    Related Posts

    install PHP GD on Ubuntu
    Ubuntu 22.04

    How to Install PHP GD on Ubuntu 22.04 [Easy Guide]

    Read More
    Install PHP on Ubuntu 22.04
    Ubuntu

    How to Install PHP on Ubuntu 22.04 [Simple Guide]

    Read More
    Install PHP 8.0 on Ubuntu
    Ubuntu 20.04

    How to Install PHP 8.0 on Ubuntu 20.04

    Read More
    Add A Comment

    Leave A Reply Cancel Reply

    install PHP GD on Ubuntu

    How to Install PHP GD on Ubuntu 22.04 [Easy Guide]

    May 2, 2023
    Install PHP on Ubuntu 22.04

    How to Install PHP on Ubuntu 22.04 [Simple Guide]

    April 26, 2023
    Install PHP 8.0 on Ubuntu

    How to Install PHP 8.0 on Ubuntu 20.04

    April 25, 2023
    Enable PHP Zip Extension

    How to Enable PHP Zip Extension in cPanel

    April 2, 2023

    Subscribe to Blog

    Enter your email address to subscribe to
    this blog and receive notifications of new posts by email.

    Facebook Twitter Instagram Pinterest
    • Sitemap
    • Privacy Policy
    • Disclaimer
    • Term of Services
    © 2023 Technoracle

    Type above and press Enter to search. Press Esc to cancel.

    Click to Copy
    Go to mobile version