Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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