shell/install/git

39 lines
1.1 KiB
Plaintext
Raw Normal View History

#!/bin/bash
##makedesc: Install git (latest)
2024-11-24 13:13:37 +00:00
source "$( dirname $(readlink -e -- "${BASH_SOURCE}"))/../helpers.sh" || exit 255
2024-07-31 15:26:12 +00:00
title
2024-07-31 15:26:12 +00:00
require make
2022-01-09 09:23:19 +00:00
2022-01-08 06:17:50 +00:00
if installed git; then
2024-07-31 15:26:12 +00:00
if [ -d "$HOME/install/git" ]; then
cd "$HOME/install/git" && \
2022-07-05 09:05:34 +00:00
git pull
else
2024-07-31 15:26:12 +00:00
clone "https://github.com/git/git.git" "$HOME/install/git" --depth=1 --single-branch && \
cd "$HOME/install/git"
2022-07-05 09:05:34 +00:00
fi
sudo make prefix=/usr/local all && \
sudo make prefix=/usr/local install
else
2024-07-31 15:26:12 +00:00
require wget
mkdir -p "$HOME/install/git"
download "https://github.com/git/git/archive/master.zip" "/tmp/git.zip" && \
unzip -oq "/tmp/git.zip" -d "$HOME/install/git" && \
2022-07-05 09:05:34 +00:00
rm /tmp/git.zip && \
2024-07-31 15:26:12 +00:00
cd "$HOME/install/git/git-master" && \
2022-07-05 09:05:34 +00:00
sudo make prefix=/usr/local all && \
sudo make prefix=/usr/local install && \
cd - && \
rm -rf git && \
2024-07-31 15:26:12 +00:00
clone "https://github.com/git/git.git" "$HOME/install/git" --depth=1 --single-branch
fi
2024-07-31 15:26:12 +00:00
[ $? = 0 ] && {
echo
success "git installed!"
git --version
echo
}