It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In RegisterIt looks like you're new here. If you want to get involved, click one of these buttons!
Git is a version control system that is designed to monitor changes to files and manage the history of those changes. Git also allows multiple people to collaborate on the same project at the same time, maintaining a history of each participant's changes.
In this guide you will learn how to install and setup git on CentOS 7 and AlmaLinux 8.
CentOS 7 has reached EOL, so you may encounter a mirror issue during installation. To solve the problem, you can refer to this guide.
To install git, run the following command:
yum install git
To ensure that git was installed successfully, check the git version:
git --version
The output will provide you the information about the installed git version.
You need to provide correct user information for Git. Run these commands (enter your actual username and email):
git config --global user.name "username"
git config --global user.email "[email protected]"
This will help you avoid Git errors in the future.
You can recheck specified information by entering:
git config --list
You can also anytime edit data via a git configuration file. Enter this command to open it:
vi .gitconfig
Inside you will see the data you provided earlier:
If you want, you can modify this data it and save changes (press "Esc", then type :wq and click "Enter").
That's it! You have Git installed and are ready to use it on your server.
You can find more information about Git on the official project website.