git push --mirror origin

Category: Git - Advanced

git push --mirror origin

Push every ref to mirror a remote

Pushes all branches, tags, and remote-tracking refs, and deletes anything on the remote that is missing locally, making it an exact copy. It can destroy branches on the remote, so never point it at a shared repository. It is meant for backup and migration mirrors.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.