1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| #!/bin/bash
yum install libcurl-devel curl-devel autoconf -y 2> /dev/null
git_link='https://www.kernel.org/pub/software/scm/git/' git_version=$(curl -s -L 'https://git-scm.com/download/linux' |grep -oE 'git-.*tar.gz') git_dir=$(echo $git_version |awk -F'.' '{print $1"."$2"."$3}') wget -c $git_link$git_version tar xf $git_version rm -f $git_version cd $git_dir
make configure slee 1
sudo ./configure --prefix=/usr/local/git sleep 1
sudo make -j 4 sleep 1
sudo make install
rm -f /usr/bin/git
ln -sf /usr/local/git/bin/git /usr/bin/
git --version
|