r/git • • 6d ago

survey Ditched GitHub (and skipped Gitea/Forgejo) for personal repos, wiki, and dotfiles: $0 3-2-1 setup with local git + restic + free R2/Dropbox + external HDD

I used to push my personal repos, markdown wiki, and dotfiles to private GitHub repos just for peace of mind, and almost spun up Forgejo on a small VPS when I decided to move off GitHub. Then I realized I didn't actually need a web UI, PRs, issues, or another daemon to patch and back up — git is already a complete history database, and a forge doesn't even solve the two things local git misses: uncommitted work and git-ignored files like .env and tool configs.

What I ended up running instead costs $0/month and uses zero background RAM. Local git handles normal committed history, and everything else is layered on restic (whole payload after excludes is ~420 MB, so it fits free tiers with years of history):

Hourly local restic snapshots run via a systemd --user timer into a separate Btrfs subvolume on the laptop (btrfs subvolume create so Snapper snapshots don't pin pack files that restic prune already deleted). That's my fast undo layer for uncommitted edits, .env files, or an accidental git reset --hard.

Every couple of weeks I plug in a USB external HDD and run one script that syncs both an encrypted restic repo and bare git clone --mirror copies for instant offline cloning. Daily offsite restic snapshots go to free-tier S3-compatible storage (Cloudflare R2's 10 GB free tier, or free Dropbox via rclone) with 14d / 8w / 12m retention, client-side AES-256 encryption, and a healthchecks.io dead man's switch that alerts me if 36 hours pass without a clean offsite run.

Compared to just pushing private repos to GitHub, the storage provider only ever sees opaque encrypted packs, accidental .env commits aren't sitting unencrypted on a third-party server, and restoring a single uncommitted file from Tuesday afternoon is one restic dump command. The only real trade-off is bootstrap discipline: if the laptop dies, you need your RESTIC_PASSWORD and offsite bucket creds stored outside the machine (password manager + paper copy) so you don't lock yourself out of your own backups.

Anyone else running pure local git + restic/borg instead of self-hosting Gitea/Forgejo, and how do you handle the "laptop stolen, need to bootstrap offsite restore from scratch" part?

0 Upvotes

2 comments sorted by

1

u/cosmokenney 6d ago

I didn't really carefully read the whole post, but what is your roll back procedure on changes that you decide to ditch and start over?

1

u/Kamensky124 6d ago

Three layers:

  • Committed work: Plain Git handles this directly (git reset --hard, git checkout, etc.).
  • Uncommitted work: Hourly Restic snapshots act as the undo layer. Running restic dump latest path/to/file pulls back the Tuesday-afternoon state of a single file.
  • "Ditch and start over": Requires no special procedure—just branch or commit from the new state. The old history remains in the append-only snapshot chain until retention prunes it naturally.

The nice side effect is that git reset --hard stops being a destructive command, because the worst-case scenario is losing one hour of work rather than the whole day.