Se desea que https://github.com/userx/A (default rama main) sobrescriba a https://github.com/userx/B (default rama master)
git clone --mirror git@github.com:userx/A.git
cd A.git/
git remote set-url --push origin git@github.com:userx/B.git
git push --mirror
---
To github.com:userx/B.git
![remote rejected] master (refusing to delete the current branch: refs/heads/master)
error: failed to push some refs to 'github.com:userx/B.git'
---
El error se debe a que no se puede eliminar la rama master, que es la default, para colocar como default a main.
Voy a https://github.com/userx/B, Settings, y cambio la rama por default a main
git push --mirror
To github.com:userx/B.git
- [deleted] master