Install Git on Oracle Linux

This guide will go through how to install Git on Oracle Linux. Git is free and open-source software for distributed version control, which tracks changes in any set of files. It is commonly used to manage the efforts of programmers working together to create source code for software.

How to Install Git on Oracle Linux

  • Update your system packages.
sudo dnf update
  • Next, install Git using the following command.
sudo dnf install git -y

Sample output

Dependencies resolved.
 Package            Arch     Version           Repository       Size
 git                x86_64   2.31.1-2.el9.2    ol9_appstream   149 k
Installing dependencies:
 git-core           x86_64   2.31.1-2.el9.2    ol9_appstream   3.7 M
 git-core-doc       noarch   2.31.1-2.el9.2    ol9_appstream   3.4 M
 perl-Error         noarch   1:0.17029-7.el9   ol9_appstream    57 k
 perl-Git           noarch   2.31.1-2.el9.2    ol9_appstream    48 k
 perl-TermReadKey   x86_64   2.38-11.el9       ol9_appstream    42 k
 perl-lib           x86_64   0.65-479.el9      ol9_appstream    24 k

Transaction Summary
Install  7 Packages

Total download size: 7.4 M
Installed size: 32 M
Downloading Packages:
(1/7): git-2.31.1-2.el9.2.x86_64.rpm  32 kB/s | 149 kB     00:04    
(2/7): perl-Error-0.17029-7.el9.noar  21 kB/s |  57 kB     00:02    
(3/7): perl-Git-2.31.1-2.el9.2.noarc  19 kB/s |  48 kB     00:02    
(4/7): git-core-2.31.1-2.el9.2.x86_6 377 kB/s | 3.7 MB     00:09    
(5/7): perl-lib-0.65-479.el9.x86_64.  11 kB/s |  24 kB     00:02    
(6/7): perl-TermReadKey-2.38-11.el9.  12 kB/s |  42 kB     00:03    
(7/7): git-core-doc-2.31.1-2.el9.2.n 255 kB/s | 3.4 MB     00:13    
Total                                551 kB/s | 7.4 MB     00:13     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                             1/1 
  Installing       : git-core-2.31.1-2.el9.2.x86_64              1/7 
  Installing       : git-core-doc-2.31.1-2.el9.2.noarch          2/7 
  Installing       : perl-lib-0.65-479.el9.x86_64                3/7 
  Installing       : perl-TermReadKey-2.38-11.el9.x86_64         4/7 
  Installing       : perl-Error-1:0.17029-7.el9.noarch           5/7 
  Installing       : perl-Git-2.31.1-2.el9.2.noarch              6/7 
  Installing       : git-2.31.1-2.el9.2.x86_64                   7/7 
  Running scriptlet: git-2.31.1-2.el9.2.x86_64                   7/7 
  Verifying        : git-2.31.1-2.el9.2.x86_64                   1/7 
  Verifying        : git-core-2.31.1-2.el9.2.x86_64              2/7 
  Verifying        : git-core-doc-2.31.1-2.el9.2.noarch          3/7 
  Verifying        : perl-Error-1:0.17029-7.el9.noarch           4/7 
  Verifying        : perl-Git-2.31.1-2.el9.2.noarch              5/7 
  Verifying        : perl-TermReadKey-2.38-11.el9.x86_64         6/7 
  Verifying        : perl-lib-0.65-479.el9.x86_64                7/7 



Configure GIT

  • Start by adding your name.
git config --global "YOUR NAME"
  • Then add your email using the following command.
git config --global "YOUR EMAIL"
  • Next, navigate to the directory with the files you want to push to git. In the example below I will create a demo directory using the command below.
mkdir demo
  • The change to the directory created above.
cd demo
  • After navigating to your directory, initialize git using the following command.
git init
  • To view more GIT info on the initialized directory run the command below.
ls -a .git
  • Print out the configuration details on the terminal using the following command.
git config --list

Sample output
[email protected]

Uninstall GIT on Oracle Linux

  • Remove GIT from your system using the following command.
sudo dnf autoremove git
  • That marks the end of our article, we have gone through how to install Git on Oracle Linux.

Read more on GIT Documentation

Other Tutorials

How to find path to a command in Linux

How to kill a process in Linux

How to move or copy a directory in Linux

System administrator | Software Developer | DevOps

Leave a Comment