Skip to content

Instantly share code, notes, and snippets.

@amercier
Last active January 3, 2016 05:58
Show Gist options
  • Save amercier/8419072 to your computer and use it in GitHub Desktop.
Save amercier/8419072 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
if [ "$(git remote | grep source | wc -l)" != "0" ]; then
echo "$0: a remote called 'source' already exists" >&2
exit 1
fi
echo -n "Source Git repo URL: "
read url
git remote add source $url \
&& git remote set-url --push source no-pushing \
&& git remote -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment