--- title: "Using mirror repositories for code backups" date: 2023-01-21T09:03:29 slug: using-mirror-repositories-for-code-backups --- This is a neat feature I just discovered for git server backups. I run a local [Gitea](http://gitea.io) server that I use for development on my own projects. I've only configured it recently, so there's not much on there. I've [mentioned in the past](https://lewisdale.dev/post/finding-my-old-hard-drive/) that I once lost access to my personal git server. It stored important content including my dissertation, which then disappeared into the void. So one thing I was quite keen on doing was making sure that I'm able to backup my git server. It turns out that's really easy to do with Gitea. You can set up a [repository mirror](https://docs.gitea.io/en-us/repo-mirror/), which will automatically sync itself with whatever remote you configure. I've set up mine to sync with my Github, so I can push to my private git server, and on a preconfigured interval it will push all my commits up. You can set it to sync on every commit, but that felt unnecessary. I quite like this approach, it feels very [POSSE-like](https://indieweb.org/POSSE): I retain ownership of my content, but it's syndicated to other places and I get some safety and redundancy.