When migrating between Git platforms like GitLab and GitHub, two approaches exist for keeping repositories in sync: using `git push --all` plus `git push --tags`, or using `git push --mirror`. The `--all` + `--tags` combination pushes all branches and tags but leaves other references untouched and does not delete anything on the remote, making it safer when the target may have platform-specific refs. The `--mirror` flag pushes the entire `refs/*` namespace and also deletes remote references that no longer exist locally, making it a true exact replica. Use `--all` + `--tags` for partial sync during coexistence periods; use `--mirror` for complete, strict mirroring or backups.

4m read timeFrom dev.to
Post cover image
Table of contents
The Common Approach: Pushing Branches and TagsThe Full Mirror OptionQuick Recommendation

Sort: