Skip to content

Instantly share code, notes, and snippets.

@jwaldrip
Last active August 25, 2017 17:02
Show Gist options
  • Save jwaldrip/8575006d8c6a32ed75bb to your computer and use it in GitHub Desktop.
Save jwaldrip/8575006d8c6a32ed75bb to your computer and use it in GitHub Desktop.
randDir=/tmp/github-migrate/$(openssl rand -hex 16)
mkdir -p $randDir
read -p "Enter the github remote: " ghremote
read -p "Enter the stash remote: " stashremote
echo ""
echo "Pulling from $ghremote"
echo ""
git clone $ghremote --mirror $randDir
cd $randDir
echo ""
echo "Pushing to $stashremote"
echo ""
git remote set-url origin $stashremote
git push
rm -rf $randDir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment