I was recently trying to download Lockpick_RCM when I found out that Nintendo filed a DMCA notice against them and the repo was taken down. This got me thinking about how I might be able to build a system that automatically and periodically clones/pulls repos. On the surface, this seems like something that would be super straight forward with a crappy script and a systemd service, but I have one thought that adds complexity. In theory, it would be possible for the maintainers of the repo to rebase and squash all commits back to some point in time. I would like to make sure that I don’t lose commits that have been squashed on the main branch, while also not losing the ability to continue updating.

As I’m writing this, I realized that one solution could be to have some logic in the script that catches when a pull fails due to a history conflict, move the current working directory off to a timestamped directory, and then clone a new copy.

I have thought about the workflow of hosting Gitea and setting up mirrors there. It sounds like a good idea, but squashed repo’s, etc would get clobbered.

Have any of set up anything to create historical (vs functional) archives of Git repo’s you don’t want to lose?