Best Practice : using Git

Hi,

I’ve got very bad luck with my project. Once again I start from scratch.
I decided to use Git for versioning and desaster recovery.
I want to save the files and the content. Some kind of hooks have to be used to flush the databese, i suppose.
Can someone advice me?

Thanks
Klaus

You can use the ./flow site:export command to export your content into your site package and then commit it to git.

Thank you Christian.

Have a nice weekend

One important point site:export is NOT a full backup (only attached resources are exported, asset tag are not included, …) so take care, this is not a full backup, and can be be promoted as a best practice.

To have a full backup you need an archive of Data/Persistent and a dump of your DB, and both need to be in sync (taken at the same moment to avoid missing resource between the database and the filesystem).

Perhaps you could also use the git pre-commit hook? For an example look at: https://gist.github.com/nuclearsandwich/904891