On this information, we are going to stroll you thru the method on The best way to set up Git on RHEL 9 or Rocky Linux 9.
Git is a strong model management system that’s extensively utilized by builders, DevOps and system admin for managing supply code adjustments. Whether or not you’re organising a growth surroundings or just want Git to your undertaking, this information will cowl all of the steps you want.
Conditions
Earlier than we begin, ensure you have:
- A system working RHEL 9 or Rocky Linux 9
- Sudo or root privileges to put in software program packages.
- Web Connectivity
With none delay, let’s dive into the set up course of!
Methodology 1: Putting in Git on RHEL 9 or Rocky Linux 9 Through DNF
The best method to set up Git on RHEL 9 or Rocky Linux 9 is through the use of the default package deal supervisor, `dnf`.
1) Replace Your System
Earlier than putting in any new software program, it’s a superb apply to replace your system packages to the most recent variations:
$ sudo dnf replace -y
2) Set up Git
Now, set up Git utilizing the next dnf command:
$ sudo dnf set up git -y
3) Confirm the Set up
To test if Git was put in efficiently, use the next command to confirm the model:
$ git --version
You must see output much like:
Above output reveals that you’ve efficiently put in Git ( 2.43.5) utilizing the package deal supervisor.
Methodology 2: Putting in Git on RHEL 9 or Rocky Linux 9 from Supply
Putting in Git from supply is one other technique that means that you can get the most recent model or a selected model of Git. This strategy is beneficial if the model out there by means of the package deal supervisor is outdated.
1) Set up Improvement instruments
Earlier than you’ll be able to construct Git from supply, that you must set up growth instruments utilizing following dnf command.
$ sudo dnf groupinstall 'Improvement Instruments' -y
It would set up the event instruments required to construct git from the supply.
Subsequent, set up different required dependencies utilizing beneath command,
$ sudo dnf set up wget curl-devel perl-ExtUtils-MakeMaker gettext openssl-devel zlib-devel curl-devel expat-devel -y
2) Obtain the Newest Git Supply Code
Go to the “https://mirrors.edge.kernel.org/pub/software/scm/git/” to search out the most recent model.
Alternatively, you’ll be able to obtain it immediately utilizing the command under:
$ wget https://mirrors.edge.kernel.org/pub/software program/scm/git/git-2.47.0.tar.gz
Word: At time of scripting this submit, newest model of Git 2.47.0 is on the market.
3) Extract the Downloaded Archive
Extract the tar file utilizing the `tar` command:
$ tar -xf git-2.47.0.tar.gz $ cd git-2.47.0
4) Compile and Set up Git
Compile the Git supply code with the next instructions:
$ make configure $ ./configure --prefix=/usr
$ sudo make all
$ sudo make set up
5) Confirm the Set up
As soon as the set up is full, confirm the put in Git model:
$ git --version
You must see the most recent Git model put in.
Good, output above reveals that you’ve put in newest model of git.
Configuring Git on RHEL 9 | Rocky Linux 9
After putting in Git, it’s important to arrange your username and e-mail handle. This info will likely be related along with your commits.
1) Set Your Username
$ git config --global person.identify "Pradeep Kumar"
2) Set Your E mail Tackle
$ git config --global person.e-mail "[email protected]"
3) Confirm the Configuration
Examine your Git configuration with the next command:
$ git config --list
You must see your username and e-mail listed within the output.
That’s all from this information, you have got efficiently discovered how you can set up Git on RHEL 9 and Rocky Linux 9 utilizing each the package deal supervisor and the supply code technique.
When you’ve got any questions or face points throughout the set up course of, be at liberty to depart a remark under!