[Solved] How can I push all branches and tags to a new remote repository? [closed]


Suppose the old repository url is https://gitlab.com/foo/oldbar.git and the new one is https://gitlab.com/foo/newbar.git.

cd local_repo
git remote set-url origin https://gitlab.com/foo/newbar.git
git push origin refs/remotes/origin/*:refs/heads/* refs/tags/*:refs/tags/*

In case you have unpushed commits on master,

git pull origin -r master
git push origin -u master

solved How can I push all branches and tags to a new remote repository? [closed]