r/statichosting • u/northboundish • 18d 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?
3
Upvotes
3
u/ad3mar 18d 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 fetch --allonce a year i actually try restoring from the backup on a clean machine. that's usually when you find the missing piece.
2
u/armahillo 18d 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
u/Wasted99 18d ago
The nice thing about git is you can check out in as many places as you like.
2
u/TCKreddituser 14d 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 18d 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 17d 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/New_Peanut_9259 13d 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
u/unspam-email 17d ago
We use Static.app and the backup is included.