If you install Git on Ubuntu 24.04, you can track changes to code, col­lab­o­rate with other de­vel­op­ers, and manage projects ef­fi­cient­ly. Git is one of the most important tools for version control in software projects.

Step 1: Which server is right for your project?

Before you install Git, you should consider what type of server you want to use for your project. Git itself requires only a few resources, but it’s often used together with de­vel­op­ment en­vi­ron­ments, web projects, or automated de­ploy­ments. In practice, two types of servers are usually suitable for this: a VPS (Virtual Private Server) or a Dedicated Server.

A VPS is es­sen­tial­ly a type of virtual machine, running on a physical host system. Multiple virtual servers share the host system’s hardware, but each is allocated its own resources, such as RAM, CPU-shares, and storage. For smaller projects, personal de­vel­op­ment en­vi­ron­ments, or initial ex­per­i­ments with Git, a VPS is often suf­fi­cient. It is flexible in terms of scal­a­bil­i­ty and typically more af­ford­able than a physical server.

A dedicated server, in contrast, gives you exclusive access to all the hardware. You do not share resources with other users. This option is par­tic­u­lar­ly suitable for larger de­vel­op­ment projects, teams with multiple de­vel­op­ers, or complex ap­pli­ca­tions with many repos­i­to­ries. A dedicated server also provides more per­for­mance reserves, making it ideal for running CI/CD pipelines or extensive build processes.

VPS Hosting
VPS hosting at un­beat­able prices on Dell En­ter­prise Servers
  • 1 Gbit/s bandwidth & unlimited traffic
  • Minimum 99.99% uptime & ISO-certified data centers
  • 24/7 premium support with a personal con­sul­tant

Step 2: Update package lists

Before in­stalling new software, you should first update your system’s package lists. Ubuntu manages software via the APT (Advanced Package Tool) package manager. It accesses central software sources and ensures that programs can be installed and updated securely. So start by updating the package in­for­ma­tion with the following command:

sudo apt update
sudo apt upgrade
bash

The command downloads the latest package lists from the Ubuntu repos­i­to­ries. This ensures that the system uses the most recent available versions of the software during in­stal­la­tion. A pre­req­ui­site is that you have sudo priv­i­leges.

Step 3: Install Git

Once the package lists are updated, you can install Git directly through the package manager. Git is included in Ubuntu’s official package sources, so no extra repos­i­to­ries are required. To complete the in­stal­la­tion, simply run the following command:

sudo apt install git -y
bash

The -y parameter au­to­mat­i­cal­ly confirms all in­stal­la­tion prompts. During the in­stal­la­tion, Ubuntu will download the necessary files and set up Git on your system. Depending on your internet con­nec­tion, this process typically takes just a few seconds.

Note

If you require graphical Git tools or in­te­gra­tions with other version control systems, you can install the git-all meta­pack­age instead of git. This meta­pack­age includes all available Git add-on packages.

Step 4: Verify the in­stal­la­tion

After in­stal­la­tion, it’s a good idea to verify that Git was installed correctly. You can do this by dis­play­ing the installed version. Run the following command:

git --version
bash

After suc­cess­ful­ly in­stalling Git on Ubuntu 24.04, the terminal will display the currently installed version number. This confirms that Git is properly installed and ready to use on your system.

Image: Git version displayed in the terminal
Dis­play­ing Git’s version number confirms that the in­stal­la­tion was suc­cess­ful.

Step 5: Configure Git

Before you start actively using Git, you should define some basic settings. These include, in par­tic­u­lar, your name and email address. This in­for­ma­tion is stored with every Git commit so that changes can be clearly assigned to a specific person.

First, set your name using the following command:

git config --global user.name "your name"
bash

Next, add your email address:

git config --global user.email "your@email-address.com"
bash

The --global option ensures that these settings apply system-wide for your user. You only need to configure them once.

To display all con­fig­ured settings, you can use the following command:

git config --list
bash

The terminal then displays an overview of all current Git settings.

Image: Git settings overview in the terminal
The settings you defined are clearly displayed in the terminal.

Step 6: Create your first repos­i­to­ry (optional)

After in­stal­la­tion and con­fig­u­ra­tion, you can follow a Git tutorial or, if you’re already familiar with Git, start using it im­me­di­ate­ly. For example, you can create a new repos­i­to­ry. First, navigate to a directory of your choice:

cd project-folder
bash

Next, ini­tial­ize a new Git repos­i­to­ry:

git init
bash

Git will then create a hidden .git directory. This is where the system stores all version control in­for­ma­tion for your project. From this point on, you can track changes, create commits, and manage your project in an organized way.

Reviewer

Go to Main Menu