Git-based FTP-deploys - Your workflow with the content-Folder?

Hello,
I read this recipe in the cookbook and am going to try it out because I want to further professionalize my projects by starting to use Git as well.

There’s one thing I’m still curious about, though:
How do you handle the content folder?
Let’s say a project is already live and the client has changed or added quite a bit of content in the meantime. Now they want another feature. So I’m working in my local development environment again, but I don’t have the latest version of the content there, right?
I’d appreciate it if you could describe your workflow for this, or if you know of another, complementary tutorial.
Thanks and best regards,
Matthias

There’s a great tool for that by @arnoson: GitHub - arnoson/kirby-deploy: Automatically upload your Kirby sites to any webspace via ftp · GitHub

Thanks for the tip. Do you use it yourself, and would you recommend it? I’m just being cautious because there’s a warning there:
“This tool is in its early stages. Use at your own risk and create a backup of your remote/local data before you apply it.”

I do use it for exactly that and haven’t noticed any issues. Because every command runs dry at first, I feel quite confident and so far everything went well :slight_smile:

Thanks!
Just out of curiosity: Do you still sync your websites to a Git repository as well?

Yes, I use kirby-deploy only for the content (mostly for pulling the latest content).

I add content folder and and anything that is loaded via composer. kirby, plugins etc into .gitignore. Then I have a bash rsync script which has a push or pull option condition to manage everything not in .git. It requires your host to have a composer hook in the repo sync path. Anything else is bitmap and non coding assets. So conceptually you have a two tier syc up and down. One with repos and one ssh.

Its a bit complex managing twin loads and twin permission lists. But for me its the best way to manage tight publishing control.

I’ve tried two ways to handle deployment with git in the past (first with a git remote on the production server, second with github actions) and both times I ran into unforeseen issues regularly. So I prefer to keep codebase versioning and deployment separate. Like @oyster I deploy my sites with rsync and I love it. I leave all the content out of the git repo (content folder, media files, storage, logs, vendor folders,…) and have a bunch of tailored rsync scripts in my package.json to push code sans content, push or pull content, or push or pull user accounts. Then each time I have to work on a site, I do npm run pull-content to get a copy of the live content and when I’m done I do npm run push to upload just the code files that have changed.