I've read about git clone --mirror <repo>
and git remote update
. But it seems that would change local mirror no matter what happened in remote repo.
What I want is a mirror backup copy of the remote repo. But if remote repo branches are force-updated I want operation to fail. I also want to avoid existing branches being removed. When force-update is performed on remote repo manual intervention would be required - that I know how to do.
The purpose of such a mirror is to protect against incidental force push
or deliberate repo hacking.
What I'm trying to ask is how to create and update a mirror git repo where the update would fail and keep existing content if origin repo branches are force-pushed or altered in some other way.
0 Answers