Skip to content

Instantly share code, notes, and snippets.

@amercier
Created February 26, 2015 23:54
Show Gist options
  • Save amercier/e7fd4c8e739357663591 to your computer and use it in GitHub Desktop.
Save amercier/e7fd4c8e739357663591 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
if [ "$(which git) 2>/dev/null" = "" ]; then
echo "git is not installed. Please install git" >&2 \
&& exit 1
fi
if [ ! -e .ssh/id_rsa.pub ]; then
echo "SSH public key not found in .ssh/, creating..." \
&& ssh-keygen -t rsa -C "[email protected]" \
&& echo "Add the following key to https://github.com/settings/ssh" \
&& cat .ssh/id_rsa.pub \
&& exit
fi
cd \
&& git init \
&& git remote add -t \* -f origin [email protected]:amercier/dotfiles.git \
&& git checkout master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment