Git updated

This commit is contained in:
Anthony Axenov 2022-07-05 17:05:34 +08:00
parent 6bb9442c43
commit f61f09b83f
Signed by: anthony
GPG Key ID: EA9EC32FF7CCD4EC

View File

@ -10,29 +10,31 @@ echo
installed() { installed() {
command -v "$1" >/dev/null 2>&1 command -v "$1" >/dev/null 2>&1
} }
ENVDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
! installed make && sudo apt install -y make ! installed make && sudo apt install -y make
if installed git; then if installed git; then
sudo rm -rf /usr/src/git if [ -d "${HOME}/install/git" ]; then
sudo git clone https://github.com/git/git.git --depth=1 /usr/src/git cd /usr/src/git/ && \
sudo chown -R $USER: /usr/src/git git pull
cd /usr/src/git/ else
sudo make prefix=/usr/local all git clone https://github.com/git/git.git --depth=1 "${HOME}/install/git" && \
sudo make prefix=/usr/local install cd /usr/src/git/
fi
sudo make prefix=/usr/local all && \
sudo make prefix=/usr/local install
else else
! installed wget && sudo apt install -y wget ! installed wget && sudo apt install -y wget
wget https://github.com/git/git/archive/master.zip -O /tmp/git.zip [ -d "${HOME}/install/git" ] || mkdir -p "${HOME}/install/git"
sudo unzip -q /tmp/git.zip -d /usr/src/git wget https://github.com/git/git/archive/master.zip -O /tmp/git.zip && \
rm /tmp/git.zip unzip -q /tmp/git.zip -d "${HOME}/install/git" && \
cd /usr/src/git/git-master rm /tmp/git.zip && \
sudo make prefix=/usr/local all cd "${HOME}/install/git/git-master" && \
sudo make prefix=/usr/local install sudo make prefix=/usr/local all && \
cd /usr/src sudo make prefix=/usr/local install && \
sudo rm -rf git cd - && \
sudo git clone https://github.com/git/git.git --depth=1 /usr/src/git rm -rf git && \
sudo chown -R $USER: /usr/src/git git clone https://github.com/git/git.git --depth=1 "${HOME}/install/git"
fi fi
git --version git --version