Skip to content

Instantly share code, notes, and snippets.

@hardikmdev
Created October 26, 2021 15:35
Show Gist options
  • Save hardikmdev/9547605c3978f89e413dbcd179be3fdb to your computer and use it in GitHub Desktop.
Save hardikmdev/9547605c3978f89e413dbcd179be3fdb to your computer and use it in GitHub Desktop.
Install or build git from source for centos, build may be necessary as centos has older version of git on repo.
# git
app_name="git"
echo "===> Checking if $app_name is installed .."
# if yum list installed "$app_name" > /dev/null 2>&1; then
# echo "===> $app_name was already installed. Nothing was done"
# else
# echo "$app_name is not installed, installing now..."
# sudo yum install git -y
# sudo yum install git -y
## updating git : generally centos has old git.
# yum install \
# https://repo.ius.io/ius-release-el7.rpm \
# https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# yum install git -y
# OR
sudo yum -y groupinstall "Development Tools"
mkdir ~/hd_tools
cd ~/hd_tools/
export VER="2.33.0"
wget https://github.com/git/git/archive/v${VER}.tar.gz
tar -xvf v${VER}.tar.gz
rm -f v${VER}.tar.gz
cd git-*
make configure
sudo ./configure --prefix=/usr
sudo make
sudo make install
# git
app_name="git"
echo "===> Checking if $app_name is installed .."
# if yum list installed "$app_name" > /dev/null 2>&1; then
# echo "===> $app_name was already installed. Nothing was done"
# else
# echo "$app_name is not installed, installing now..."
# sudo yum install git -y
# sudo yum install git -y
## updating git : generally centos has old git.
# yum install \
# https://repo.ius.io/ius-release-el7.rpm \
# https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# yum install git -y
# OR
sudo yum -y groupinstall "Development Tools"
mkdir ~/hd_tools
cd ~/hd_tools/
export VER="2.33.0"
wget https://github.com/git/git/archive/v${VER}.tar.gz
tar -xvf v${VER}.tar.gz
rm -f v${VER}.tar.gz
cd git-*
make configure
sudo ./configure --prefix=/usr
sudo make
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment