How to Install Git on AlmaLinux 10

Published: 2026-06-25
Google AdSense 广告位 (待申请通过后开启)

Introduction

Git is the most widely used distributed version control system for software development. It allows developers to track code changes, collaborate with teams, and manage project history efficiently.

This guide explains how to install Git on AlmaLinux 10, verify the installation, and perform basic configuration.

Update System Packages

Before installing Git, update the package metadata:

sudo dnf update -y

Install Git

Install Git using DNF:

sudo dnf install git -y

The package manager will automatically download and install all required dependencies.

Verify the Installation

Check the installed Git version:

git --version

Example output:

git version 2.x.x

This confirms that Git has been installed successfully.

Configure Git Username and Email

Before creating commits, configure your identity.

Set your username:

git config --global user.name "Your Name"

Set your email address:

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

Verify the configuration:

git config --list

Example output:

user.name=Your Name
user.email=your@email.com

Create a Test Repository

Create a directory:

mkdir git-test
cd git-test

Initialize a Git repository:

git init

Expected output:

Initialized empty Git repository

Create and Commit a File

Create a file:

echo "Hello Git" > README.md

Add the file:

git add README.md

Create the first commit:

git commit -m "Initial commit"

View commit history:

git log --oneline
demo
demo

Clone a Remote Repository

Clone an existing repository:

git clone https://github.com/git/git.git

After cloning, Git will download the repository contents into a local directory.

Display Current Git Configuration

To display all Git settings:

git config --list

To display the configured username:

git config user.name

To display the configured email:

git config user.email

Remove Git Configuration

Remove the configured username:

git config --global --unset user.name

Remove the configured email:

git config --global --unset user.email

Uninstall Git

Remove Git from AlmaLinux 10:

sudo dnf remove git -y

Verify removal:

git --version

You should receive a command not found error.

Conclusion

Installing Git on AlmaLinux 10 is straightforward using DNF. After installation, configure your username and email, create a repository, and start tracking project changes with Git.

Related AlmaLinux 10 Tutorials

How to Install OpenJDK 21 on AlmaLinux 10

How to Install Maven on AlmaLinux 10

How to Install Gradle on AlmaLinux 10

Explore More

Technology Guides →

Southeast Asia Insights →