I have a website with multiple folders that have different purposes on the site. Think
/
/forum
/drupal_site
/contact
/about_us
Now how should I handle backups for these? Should each folder have its own repository? Should there be one for the entire site? Is Git the way to go in the first place?
Does it not make a difference and is up to whatever is more convenient to me?
Is there any “standard” way to do this or each person does it differently?
Also should each of those folders have their own js css and img folders or should that be shared across the site (only in the root)?
You have the flexibility to do a few different things here, but I think starting your repo at the root
/and tracking your files recursively is the way to go. Git will pick up the files in your subfolders.The key advantage to this is that you basically have snapshots of your entire app, and can easily checkout the repository when creating a development or staging environment.
Git is great for managing the code changes, but I’d still suggest using something like
rsyncto backup the entire site every once in a while. That way, you can only track files that are going to change consistently (code, user generated content, etc) instead of backing up images/audio/other that are NOT going to be changed. Better to be safe than sorry 🙂