Last active
October 10, 2015 20:38
-
-
Save faloi/3747476 to your computer and use it in GitHub Desktop.
First-time Git setup with ssh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NAME=$1 | |
EMAIL=$2 | |
done_message() { | |
echo "Done!" | |
echo "" | |
} | |
if [ -z "$1" ] || [ -z "$2" ]; then | |
echo "Couldn't run script!" | |
echo "Usage is sh gitinit.sh [your_name] [your_email]" | |
exit 1 | |
fi | |
echo "Setting up git global settings..." | |
git config --global user.name $NAME | |
git config --global user.email $EMAIL | |
git config --global color.ui true | |
done_message | |
echo "Creating ssh key, press ENTER when prompted for filename..." | |
ssh-keygen -t rsa -C $EMAIL | |
done_message | |
echo "Copying your brand new ssh key to your clipboard..." | |
clip < ~/.ssh/id_rsa.pub | |
done_message | |
echo "Now go to your remote git provider (e.g. GitHub, BitBucket) and paste it!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment