Skip to content

Instantly share code, notes, and snippets.

@prmichaelsen
Created October 24, 2016 23:16
Show Gist options
  • Save prmichaelsen/026050279132c6d7cb101b40919a639e to your computer and use it in GitHub Desktop.
Save prmichaelsen/026050279132c6d7cb101b40919a639e to your computer and use it in GitHub Desktop.
#!/bin/bash
# script for cloning repos from org
# and setting up remotes
# must have existing fork of target repo
if [ "$#" -ne 2 ]; then
echo "Usage: clone_repo.sh <git username> <repository name>"
else
git clone https://www.github.com/"$1"/"$2".git "$2"
git -C ./"$2" remote add upstream https://www.github.com/prmichaelsen/"$2".git
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment