Skip to content

Instantly share code, notes, and snippets.

@maxweber
Created November 10, 2015 10:09
Show Gist options
  • Save maxweber/e5b9a608b2dd7297e913 to your computer and use it in GitHub Desktop.
Save maxweber/e5b9a608b2dd7297e913 to your computer and use it in GitHub Desktop.
Duplicates one complete git repo into another empty git repo. Based on https://help.github.com/articles/duplicating-a-repository/
#!/bin/bash
temp_dir=`mktemp -d -t repo`
echo $temp_dir
git clone --bare $1 $temp_dir
cd $temp_dir
git push --mirror $2
rm -rf $temp_dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment