Bobcares

How to Setup Git On Ubuntu 24.04?

by | Sep 4, 2024

Using Git on Ubuntu 24.04 comes with several benefits. This post offers a detailed guide on Setup of Git on Ubuntu 24.04. At Bobcares, with our Server Management Service, we can handle your issues.

Overview
  1. Setup of Git on Ubuntu 24.04
  2. An Introduction on Ubuntu 24.04
  3. An Introduction on Git
  4. Prerequisites for the Setup
  5. Methods to Set up Git on Ubuntu 24.04
  6. Benefits of Git on Ubuntu 24.04
  7. Conclusion

Setup of Git on Ubuntu 24.04

An Introduction on Ubuntu 24.04

Ubuntu 24.04 LTS includes a number of features that will make it feel completely at home in the organization. Netplan is provided as the default tool for configuring networking on the desktop (as it has been for servers), allowing administrators to configure their Ubuntu estate regardless of platform.

GNOME 46 includes a number of speed and usability enhancements, such as improved file manager search and performance, expanding notifications, and streamlined settings options for easy access. Provisioning options is also improved by adding ZFS encryption to our installer and integrating autoinstall support. That, together with the new App Center and a dedicated app for firmware upgrades, provides a more comprehensive experience – as well as improved speed.

Under the hood, Ubuntu 24.04 LTS contains further security enhancements for individuals who create and distribute software within the Ubuntu ecosystem. Ubuntu 24.04 LTS provides us with more options to secure the apps and data, including a more robust distribution of Personal Package Archives (PPAs), better limitations on unprivileged user namespaces in AppArmor, and an improved suggested pocket for granular package installation.

An Introduction on Git

Git is a distributed version control system that tracks changes to source code during software development. It allows numerous developers to work together on a project, resulting in a disciplined and organized development process. The main concepts are as follows:

1. Repository (Repo): A repository stores the project’s files as well as the whole history of updates.

2. Commit: A commit is a snapshot of the project at a certain point in time that preserves changes and allows us to roll back if necessary.

3. Branch: Branches let us to work on distinct features or bug fixes separately, avoiding conflicts in the main codebase.

4. Merge: Merging integrates modifications from different branches into a single branch, ensuring a consistent codebase.

Prerequisites for the Setup

1. SSH root access or a system user with sudo rights.

2. An Ubuntu 24.04 VPS

3. A minimum of 2GB of RAM.

Methods to Set up Git on Ubuntu 24.04

To begin, connect in to the Ubuntu 24.04 using SSH:

ssh root@IP_Address -p Port_number

Replace ‘IP_Address’ and ‘Port_number’ with the server’s current IP address and SSH port number. If necessary, replace ‘root’ with the username for the sudo account. Once logged in, ensure that any UbuntuOS packages installed on the server are up to date. We can accomplish this by using the following commands:

apt update -y && apt upgrade -y
Method 1

1. Because Git is frequently pre-installed on Ubuntu 24.04, we should first use the following command to see if it is already installed on the machine.

git --version

2. The above output indicates that Git is already installed. If Git is not already installed on the system, use the following command to install it from official repositories:

sudo apt install git

setup Git On Ubuntu 24.04

Method 2

To install a specific version of Git on Ubuntu, we can compile it from the source. Here’s a simplified process:

1. Install Required Libraries:

bash

sudo apt install build-essential libz-dev libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext cmake gcc -y

2. Download Git Source Code (replace 2.45.2 with the desired version):

bash

curl -L https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.45.2.tar.gz -o git-2.45.2.tar.gz

3. Extract the Downloaded File:

bash

tar -zxf git-2.45.2.tar.gz

4. Compile and Install Git:

bash

cd git-2.45.2/
make prefix=/usr/local all
sudo make prefix=/usr/local install

5. Verify the Installation:

bash

git --version

This will display the installed Git version.

Benefits of Git on Ubuntu 24.04

1. Ubuntu, a popular Linux distribution, includes native support for Git, making installation and updates simple from the terminal.

2. Many developers prefer to use Git from the command line due to its flexibility and powerful features, and Ubuntu’s terminal provides a reliable environment for this.

3. Ubuntu has various development tools and IDEs (such as VS Code and IntelliJ) that interact flawlessly with Git, improving workflow efficiency.

4. Ubuntu’s package manager (APT) delivers consistent and secure updates for Git, guaranteeing that we are running a dependable and safe version.

5. Git on Ubuntu allows for significant customisation and the ability to develop scripts to automate common Git processes, hence enhancing productivity.

6. Running Git on Ubuntu often delivers superior performance due to optimized memory and CPU consumption than certain other operating systems.

7. Git on Ubuntu provides a secure version control system, which is very useful in collaborative and professional software development situations.

[Want to learn more? Reach out to us if you have any further questions.]

Conclusion

Git helps us manage code changes. On Ubuntu 24.04, we can install Git using the apt package manager or from a tar.gz source file. The apt method is quick but might not install the latest version. Using the tar.gz file ensures we get the latest version but takes more time. We can choose any of the method offered by our Support Team based on the needs and carefully follow the steps for installation and configuration.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF