Last active
November 10, 2023 09:12
-
-
Save BTabaku/b85d195ac5e4a0ba05cbd2745b9d608a to your computer and use it in GitHub Desktop.
Installing / upgrading git manually on CentOS 7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install the required Perl module | |
sudo cpan ExtUtils::MakeMaker | |
# Remove the old Git | |
sudo yum remove git | |
# Download the latest Git sources | |
wget https://github.com/git/git/archive/refs/tags/v2.35.1.tar.gz | |
# Extract the downloaded file | |
tar -xzf v2.35.1.tar.gz | |
# Navigate to the extracted directory | |
cd git-2.35.1 | |
# Compile and install Git | |
make prefix=/usr/local all | |
sudo make prefix=/usr/local install | |
# Add the path of the new Git binary to the .bashrc file | |
echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bashrc | |
# Source the .bashrc file for the changes to take effect | |
source ~/.bashrc | |
# Check the Git version | |
git --version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment