Created
February 16, 2017 17:08
-
-
Save tarranjones/71bdd326214ac5c938a7c4d4a58ba221 to your computer and use it in GitHub Desktop.
How to Move a Git Repo
This file contains hidden or 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 -p ~/prestine/ #stores prestine git repos, no dev happens here (mostly just used for phpstorm framework intergartion) | |
move_repo(){ | |
rm -fr ~/prestine/$2 | |
git clone https://$1.git ~/prestine_repos/$2 | |
cd ~/prestine_repos/$2 | |
git remote set-url origin https://$2.git | |
git push origin master | |
cd - | |
} | |
# usage | |
move_repo github.com/username/reponame bitbucket.org/username/reponame |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment