my-env/install/010-git.sh

29 lines
1001 B
Bash
Raw Normal View History

#!/bin/bash
2022-01-08 06:17:50 +00:00
echo
echo "==============================================="
echo "Installing git..."
echo "==============================================="
echo
2022-01-08 06:17:50 +00:00
if installed git; then
[ ! -d "/usr/src/git" ] && sudo git clone https://github.com/git/git.git --depth=1 /usr/src/git
2022-01-09 09:14:15 +00:00
sudo chown -R $USER: /usr/src/git
cd /usr/src/git/
sudo make prefix=/usr/local all
sudo make prefix=/usr/local install
else
sudo wget https://github.com/git/git/archive/master.zip -O /usr/src/git.zip
sudo unzip /usr/src/git.zip -d /usr/src/git
sudo rm -f /usr/src/git.zip
cd /usr/src/git/git-master
sudo make prefix=/usr/local all
sudo make prefix=/usr/local install
cd /usr/src
sudo rm -rf git
sudo git clone https://github.com/git/git.git --depth=1 /usr/src/git
2022-01-09 09:14:15 +00:00
sudo chown -R $USER: /usr/src/git
fi
2022-01-09 09:14:15 +00:00
ENVDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
DOTFILESDIR="$ENVDIR"/dotfiles
2022-01-08 06:17:50 +00:00
git --version
2022-01-09 09:14:15 +00:00
cp $DOTFILESDIR/.gitconfig $HOME/.gitconfig