dotfiles/scripts/git.sh

51 lines
1.2 KiB
Bash
Raw Normal View History

2021-08-15 16:01:10 +00:00
#!/usr/bin/env bash
2022-04-17 15:12:34 +00:00
VERSION="2.35.2"
2021-08-15 16:01:10 +00:00
2021-08-16 07:03:25 +00:00
function install () {
cd ~
wget https://github.com/git/git/archive/refs/tags/v${VERSION}.zip
sudo unzip v${VERSION}.zip
cd git-${VERSION}
sudo make prefix=/usr/local all
sudo make prefix=/usr/local install
cd ~
sudo rm -rf git-${VERSION}
sudo rm v${VERSION}.zip
2021-08-17 05:08:52 +00:00
printf "\n\n"
git --version
2021-08-16 07:03:25 +00:00
}
2021-08-15 16:01:10 +00:00
2021-11-24 14:14:39 +00:00
function uninstall () {
sudo rm /usr/local/bin/git
}
2021-08-16 07:03:25 +00:00
function setup () {
echo "create a ssh key"
echo "gimme your email: "
read EMAIL
ssh-keygen -t rsa -C $EMAIL
echo "create a gpg key"
gpg --full-generate-key
gpg --list-secret-keys --keyid-format=long
echo "enter the secret on sec rsa4096/THIS PART: "
read SECRETKEY
gpg --armor --export $SECRETKEY
git config --global user.signingkey $SECRETKEY
echo "now go to the .ssh directory, copy the contents of the id_rsa.pub to github"
echo "then copy the public key block above also to github"
echo "link to speed up everything: https://github.com/settings/keys"
}
if [ "$1" == "install" ]; then
install
elif [ "$1" == "setup" ]; then
setup
elif [ "$1" == "uninstall" ] || [ "$1" == "remove" ]; then
uninstall
else
echo "please specify args with install or uninstall"
2021-11-24 14:14:39 +00:00
fi