From e7943931eb39d3b91a6488aa0133dcf725a83d99 Mon Sep 17 00:00:00 2001 From: askiiart Date: Sat, 19 Aug 2023 17:04:13 -0500 Subject: [PATCH] Add fedora git setup --- daily-use-pcs/fedora/setup-git.sh | 46 +++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 daily-use-pcs/fedora/setup-git.sh diff --git a/daily-use-pcs/fedora/setup-git.sh b/daily-use-pcs/fedora/setup-git.sh new file mode 100644 index 0000000..a1aa051 --- /dev/null +++ b/daily-use-pcs/fedora/setup-git.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# Wait until enter is pressed +# read -p "Press Enter to continue" < /dev/tty + +sudo dnf install git -y + +# Install git credential manager +curl -L https://aka.ms/gcm/linux-install-source.sh | sh +git-credential-manager configure + +############################################ +# Do GPG key stuff for commit verification # +############################################ + +# Create GPG key +echo "> $ gpg --full-generate-key" +echo Use the defaults, then real name "askiiart", email address \"dev@askiiart.net\", and comment \"git key\"\n +gpg --full-generate-key +read -p "Copy the long ID above, then paste it here: " KEY_ID +echo $KEY_ID + +# Export GPG key +gpg --armor --export $KEY_ID +echo This is the exported key, copy it and put it in Git* +echo Gitea URL: https://git.askiiart.net/user/settings/keys +echo GitHub URL: https://github.com/settings/gpg/new +read -p "Press enter when you're done" < /dev/tty + +############# +# SSH stuff # +############# + +# Generate SSH keys +echo +# -f: file, -N: passphrase, -t: type +ssh-keygen -f ~/.ssh/id_rsa -N "" -t rsa + +# Get SSH key +echo +cat ~/.ssh/id_rsa.pub +echo This is the SSH public key, copy it and put it in Gitea/GitHub/whatever +echo Gitea URL: https://git.askiiart.net/user/settings/keys +echo GitHub URL: https://github.com/settings/ssh/new + +read -p "Done. Now verify your SSH and GPG keys in Git*" < /dev/tty \ No newline at end of file