I am having a use case where we are migrating from one remote to another for a project.
legacy_remote : The existing remote which has been existing so far. new_remote : The new remote on which all data has to be pushed from legacy remote.
I am using in following commands.
git remote set-url origin <legacy_remote>
git checkout master
git pull
git remote set-url origin <new_remote>
git push --force -u origin --all
git push origin --tags
The reason i am using force keyword is that every time i do a merge i don't want to resolve the conflicts in new remote but rather replace the content in there on new remote as its not being used so far.
The problem which is happening is that command :
git push --force -u origin --all
This command is only syncing master to master but not moving all branches from legacy remote onto the new remote. Can anyone please tell what's missing in command.