Remote mirror

Note

Every fetch overrides any local change.

Thus this is meant to be in one direction only.

Thereby useful only for full backup, and not distributed working repo system.

Two types - push and pull.

So instead

Main

git remote set-url --push origin <mirrored>

Clones

git clone --bare <ORIGIN_URL>
git remote add --mirror=fetch repo1 <URL>
git fetch origin --tags

git fetch origin *:*

Uses this if fetch is going to FETCH_HEAD instead.

Causing git log to stay detached.

To update mirrors from original.

Add mirrors’ urls to original.

Updated: 2026 Aug 19