Git is the most popular distributed version control system, but it doesn’t come pre-installed on desktop versions of Ubuntu. Installing Git on Ubuntu is simple as it is available through Ubuntu's default APT repository. This allows users to install Git directly from the terminal using APT.
APT handles the installation of software and ensures Git is downloaded with the necessary dependencies, such as git-man and liberror-perl. The installation process is quick and doesn't require manual configuration. Users will be able to use Git for version control tasks immediately after installation.
For those who prefer a graphical user interface, various Git GUI clients like GitKraken, Sublime Merge, and Git Cola are available. These tools can be installed separately to provide a visual interface for managing Git repositories. Both command-line and GUI options are supported on Ubuntu versions like 22.04 and 23.10.
Steps to install Git on Ubuntu:
- Open the terminal from the application launcher or use the <ctrl> + <alt> + <t> keyboard shortcut.
- Update the APT package list to ensure all packages are up-to-date.
$ sudo apt update [sudo] password for user: Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [97.5 kB] Hit:2 http://archive.ubuntu.com/ubuntu jammy InRelease Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [97.5 kB] Fetched 284 kB in 1s (198 kB/s) Reading package lists... Done Building dependency tree Reading state information... Done All packages are up to date.
- Install the Git package via APT.
$ sudo apt install git [sudo] password for user: Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: git-man liberror-perl The following NEW packages will be installed: git git-man liberror-perl 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. Need to get 5,528 kB of archives. After this operation, 38.1 MB of additional disk space will be used. Do you want to continue? [Y/n] Y
Ensure that APT installs all required dependencies during the process.
- Verify the installation by checking the Git version.
$ git --version git version 2.34.1
- Optionally, install a Git GUI client for a graphical interface.
Some popular Git GUI options include:
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.
Comment anonymously. Login not required.