Close Menu
Technoracle
    Facebook X (Twitter) Instagram
    Facebook X (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

    Toggle
    • 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 "[email protected]"

    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 [Easy Guide]
    Rajesh Shivam
    • LinkedIn

    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

    linux commands every user should know in 2025
    Ubuntu 24.04

    25 Must-Know Linux Commands Every User Should Master in 2025

    Read More
    TeamViewer and Ubuntu logos on gradient background – banner for how to install TeamViewer on Ubuntu 24.04 tutorial
    Ubuntu 24.04

    How to Install TeamViewer on Ubuntu 24.04 [Fast & Easy Steps]

    Read More
    Troubleshooting ‘Permission Denied (publickey)’ SSH error on a Linux server using secure terminal access
    Ubuntu

    Fix ‘Permission Denied (publickey)’ SSH Error on Linux [Step-by-Step Guide]

    Read More
    Add A Comment
    Leave A Reply Cancel Reply

    linux commands every user should know in 2025

    25 Must-Know Linux Commands Every User Should Master in 2025

    April 10, 2025
    TeamViewer and Ubuntu logos on gradient background – banner for how to install TeamViewer on Ubuntu 24.04 tutorial

    How to Install TeamViewer on Ubuntu 24.04 [Fast & Easy Steps]

    April 10, 2025
    Troubleshooting ‘Permission Denied (publickey)’ SSH error on a Linux server using secure terminal access

    Fix ‘Permission Denied (publickey)’ SSH Error on Linux [Step-by-Step Guide]

    April 8, 2025
    Blog banner showing Ubuntu logo, coding laptop, and icons for VS Code, Docker, and Git with the title 'Perfect Dev Setup in Ubuntu 24.04 – Step-by-step guide for developers' on a dark tech-themed background.

    How to Set Up the Perfect Development Environment on Ubuntu 24.04

    April 8, 2025

    Subscribe to Blog

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

    Facebook X (Twitter) Instagram Pinterest
    • Sitemap
    • Privacy Policy
    • Disclaimer
    • Term of Services
    © 2025 Technoracle

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

    Click to Copy