In this tutorial, we will show you how to install Git on Fedora 38. For those of you who didn’t know, Git revolutionized version control systems with its distributed nature, allowing developers to work offline and collaboratively on the same project. Unlike centralized systems, Git stores the entire project’s history on each developer’s machine, enabling swift and independent development. Git provides features like branching, merging, and extensive tracking capabilities, making it an indispensable tool for managing source code.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘
sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of Git on a Fedora 38.
- A server running one of the following operating systems: Fedora 38.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies for Git.
non-root sudo useror access to the
root user. We recommend acting as a
non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.
Install Git Fedora 38
Step 1. Before we can install Git on Fedora 38, it’s important to ensure that our system is up-to-date with the latest packages. This will ensure that we have access to the latest features and bug fixes and that we can install Git without any issues:
sudo dnf update
Step 2. Installing Gitea on Fedora 38.
Now that we have prepared the system, we can proceed with the installation of Git on Fedora 38. There are two common methods for installation: using the package manager and building from the source.
- Installation Method 1: Using the Package Manager.
The package manager simplifies the installation process and ensures that all dependencies are resolved automatically. Open a terminal and execute the following command to install Git using the package manager:
sudo dnf install git
Confirm the installation by typing ‘Y‘ when prompted, and the package manager will take care of the rest.
Verify that Git has been installed by running the following command:
- Installation Method 2: Building from Source.
Building Git from a source provides flexibility, allowing you to customize the installation and have the latest version. First, visit the official Git website and navigate to the Downloads section and download the latest stable version of Git as a tarball.
Next, navigate to the directory where you saved the tarball and use the following command to extract the source code:
tar -xf git-<version>.tar.gz
Change to the extracted Git source code directory using the following command:
Configure the build process by executing the following command:
Once the configuration is complete, build and install Git by running:
make && sudo make install
To ensure that Git has been installed successfully on Fedora 38, it is essential to perform a verification check:
If Git is installed correctly, the command will display the version number. Additionally, you can verify the Git configuration by executing:
git config --list
Step 3. Configuring Git on Fedora 38.
After installing Git, it is crucial to configure it properly to ensure accurate attribution of commits and optimize your workflow.
- A. Setting Up User Information:
To configure your Git username and email address, execute the following commands in the terminal:
git config --global user.name "Your Name" git config --global user.email "email@example.com"
Replace “Your Name” with your actual name and “firstname.lastname@example.org” with your email address. This information will be associated with your commits.
- B. Customizing Git Preferences:
Git offers various customization options to enhance your version control experience. Here are a few examples of common Git configurations:
- Setting up aliases:
Git aliases allow you to create shortcuts for frequently used commands. For instance, you can create an alias to substitute ‘git status’ with ‘git st’ by executing:
git config --global alias.st status
- Enabling colorful output:
Git can provide color-coded output for improved readability. Enable this feature by executing the following command:
git config --global color.ui auto
Congratulations! You have successfully installed Git. Thanks for using this tutorial for installing Git on your Fedora 38 system. For additional help or useful information, we recommend you check the official Git website.