Git Mirroring

intro

git mirroring is a process of replicating a repository from one location to another one. to ensure that there are multiple copies of the repository available for use when needed. these mirrors can be used as backups, or to ensure accessing repositories easily for large distributed teams.
of course, git mirroring can be done manually by copying the repo files to other locations, but this approach will make it difficult to keep the copies in sync.

steps

git hooks

finally, we can use git push --mirror mirror to push changes to the mirror from the original repo , but if we want to make this process happen automatically when we push changes to the src, we can use git hooks :
inside the SRC/.git/hooks/ create a file called post-commit and put the following code in it:

git push --mirror mirror

and make it executable

chmod +x mirroring.sh