Interview Prep/Git & GitHub/Conflicts, remotes, fetch, pull and push

How do multiple remotes and push URLs allow mirroring on push?

AdvancedConceptConflicts, remotes, fetch, pull and push
Answer

A remote can have several pushurl entries, so one git push origin goes to all of them. Fetch uses only the first URL, so this is a lightweight way to mirror to a second host.

git remote set-url --add --push origin [email protected]:org/repo.git
git remote set-url --add --push origin [email protected]:org/repo.git
All Git & GitHub questions Roadmap: Git & GitHub

More on Conflicts, remotes, fetch, pull and push