Created
January 14, 2015 16:05
-
-
Save Phocacius/72ec83d8b9c890028b71 to your computer and use it in GitHub Desktop.
copies an arbitrary Git repo (including all branches and tags) and pushs it to another repo. The destination repo has to be completely empty!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir tmp | |
echo 'Enter URL of old repo:' | |
read oldrepo | |
echo 'Enter URL of new repo:' | |
read newrepo | |
cd tmp | |
git clone --bare $oldrepo | |
REPO=`ls` | |
cd $REPO | |
git remote add destination $newrepo | |
git push --all destination | |
git push --tags destination | |
cd .. | |
rm -rf $REPO | |
cd .. | |
rm -rf tmp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment