r/statichosting • u/northboundish • 13d ago
Is keeping everything in Git enough for backing up a static website?
since most static site projects already use Git, it seems like a good way to keep track of both code and content. but I’m wondering if relying on a remote repository is enough in the long run.
do you keep separate backups of your content and assets, or is your Git repository usually all you need?
2
u/armahillo 13d ago
i use jekyll. I have my static host set up with a webhook from github, when i push up to github, it triggers a fresh build automatically.
so yes, it functions as a backup, but its also an integral
part of the build pipeline
2
2
u/TCKreddituser 10d ago
Yes, it is. As long as everything, including your content and assets, is committed and pushed to a remote repository, Git would be enough for most static websites. But I do keep backup.
1
u/sourraine 13d ago
i usually treat git as my first line of backup but i wouldnt rely on it as the only one. ive had projects where the repo contained all the code but some assets and client-provided files were stored elsewhere
1
u/Erfrischendfair 13d ago
since you're backing up every single fucking aspect of the website yeah it is. keep important apache config in .htaccess or any nginx equivalent
1
u/Pink_Sky_8102 13d ago
A simple test is to clone the repo into a clean folder or fresh machine once in a while and try to rebuild the site from scratch. Write down anything you have to fetch manually, any env values you need, and any setup step that isn’t in the repo. Then either add it to the project docs or back it up separately.
1
u/New_Peanut_9259 9d ago
git is a solid backup for the files it tracks, but it doesn't protect you from losing access to the remote account or accidentally deleting something important. i'd keep a separate copy of the repository and make sure any assets or generated files outside git are included too
-2
3
u/ad3mar 13d ago
git covers most of it, but a single remote isn't really a backup. if your github account gets locked or someone force-pushes over history, every copy you have came from that one place. i push to a second remote (gitlab or codeberg) and occasionally run
git bundle create site.bundle --allto keep a single-file copy on an external drive.things that quietly don't live in the repo:
git LFS files. a normal clone only has pointers unless you run
git lfs fetch --allanything gitignored, like .env files or API keys for builds
settings in your host's dashboard: redirects, headers, env vars, custom domain config
DNS records. screenshot or export them, since they're painful to rebuild from memory
content in a headless CMS, form submissions, comments, etc.
once a year i actually try restoring from the backup on a clean machine. that's usually when you find the missing piece.