# Git mirror

A Git mirror is a copy of a repository that Avrea stores in its own
datacenters and keeps in sync with GitHub. CI jobs check out from the mirror
instead of downloading the same objects from GitHub, and you can clone from it
with the CLI.

## Turn the mirror on

Organization admins turn the mirror on under the repository's **Settings →
Git mirror** with **Mirror this repository**. Enabling
[Git checkout acceleration](/cache/git-checkout/) creates and maintains the
same mirror, so a repository with checkout acceleration already has one.

The line under the switch shows the state of the mirror. A new mirror syncs
first; **Ready** means every location holds a current copy.

## Locations

Under **Locations**, choose where Avrea keeps the copy. Changes apply right
away. Switching a location off only stops its sync: the copy stored there is
kept, and switching the location on again brings it up to date with the next
sync.

Turning the mirror off switches every location off the same way and keeps the
stored copy. Remove it with **Delete stored copy** when it is no longer
needed. This deletes the copy in every location, including anything stored
only at Avrea; the repository on GitHub is not changed, and turning the mirror
on again fetches a new copy.

## Clone from the mirror

Once the mirror is ready, the repository's **Overview** in the console shows
the clone command:

```bash
avr repo clone owner/repository
```

It needs the [CLI](/cli/), signed in with `avr auth login`. Pulls come from
the mirror; push through your usual GitHub remote.

## What uses the mirror

- [Git checkout acceleration](/cache/git-checkout/) prepares CI checkouts
  from it.
- [Slack commit feeds](/observability/#slack-notifications) post the commits
  of mirrored repositories.
- `avr repo clone` clones from it.