Skip to content

Instantly share code, notes, and snippets.

@tarranjones
Created February 16, 2017 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tarranjones/71bdd326214ac5c938a7c4d4a58ba221 to your computer and use it in GitHub Desktop.
Save tarranjones/71bdd326214ac5c938a7c4d4a58ba221 to your computer and use it in GitHub Desktop.
How to Move a Git Repo
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