Skip to content

Instantly share code, notes, and snippets.

@BladeF
Created July 11, 2020 18:49
Show Gist options
  • Save BladeF/17f69fbbf9dc30b50bef042d418678b9 to your computer and use it in GitHub Desktop.
Save BladeF/17f69fbbf9dc30b50bef042d418678b9 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "************"
echo "Initializing repo..."
git init
echo "Init finished"
echo "************"
echo ""
echo "************"
read -p "Please specify a repo type (school, work, personal): " repo
read -p "Enter remote URL: " url
if [ $repo == "school" ]; then
git config --local user.name "Freddie Falcon"
git config --local user.email ffalcon@school.edu
git config --local core.sshCommand "ssh -i ~/.ssh/school_key"
git remote add origin $url
elif [ $repo == "work" ]; then
git config --local user.name "Freddie Falcon"
git config --local user.email freddie.falcon@work.com
git config --local core.sshCommand "ssh -i ~/.ssh/work_key"
git remote add origin $url
elif [ $repo == "personal" ]; then
git config --local user.name "Freddie Falcon"
git config --local user.email freddie_the_falcon@test.com
git config --local core.sshCommand "ssh -i ~/.ssh/id_rsa"
git remote add origin $url
else
echo "$repo is not a valid init option: school, work, personal. Try again."
exit 1
fi
echo "************"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment