-
Clone the the repository git clone https://code.google.com/p/my_repo cd my_repo
-
List all local and remote branches. Note: All branches will be pushed later, both local and remote. git branch -a
-
Track all remote branches. for remote in
git branch -r | grep -v '\->'
; do git branch –track ${remote#*/} $remote; done -
Add the new remote repository. git remote add new-origin git@github.com:user/my_repo.git
git remote -v
-
Push all branches to the new remote repository location. git push -u –all new-origin
-
Push all tags to the new remote repository location. git push –tags new-origin
-
Remove or rename the old origin git remote rm origin # or rename ‘git remote rename origin old-origin'
-
Rename the new-origin. git remote rename new-origin origin
git remote -v
comments powered by Disqus