Hi @maurolopes and thanks for this question.
There are many ways you can achieve this, I’ll share with you how we do it.
We’re using for the site repos where Gitium is used, the file structure from here:
https://github.com/presslabs/gitium-base
You can simply clone it, then copy the file structure, then add your theme and plugin files on top, then push everything to the repo you’ll be using with Gitium.
It comes with a predefined setup for a local environment that works with Vagrant & Vbox. All you have to do is to import a DB dump, some images and you can find more details about how you can achieve that on this article from our documentation. In this way you’ll be able to do changes and check them locally before getting them pushed to the repo.
Please let us know if this works as expected for you.
Best regards,
Pedro/Presslabs team
Thanks, but I use MAMP (mac) as my local environment. Any hint on using gitium with this setup?
This is something I haven’t tested as I haven’t used MAMP for quite some time now. Would it work if you cloned the repo directly in the MAMP setup? depending on the structure you have with your repo, this would probably be the easiest way. Then you test all changes on MAMP and only commit & push when happy with the result.
Would something like this work?
Pedro/Presslabs Support Team
Yeah, but Gitium generates a wp-content folder that misses some files and subfolders. That is the main problem. I can clone the gitium repo on my wp local installation, but what about the files that git is ignoring?
Well, that’s the whole beauty of the gitignore! You can alter the gitignore file in order to fit it to your needs. For example, I don’t see any reason why you’d have /uploads/ or /upgrade/ or /backups/ in git! The main folders that you’d probably be interested in storing in git are: /plugins/, /themes/ and /languages/. Maybe some other specific plugin folders, depending on what you’re using, but that’s about it.
Getting back to your issue:
Yeah, but Gitium generates a wp-content folder that misses some files and subfolders.
Add the files you need on top of the wp-content folder generated by Gitium, then add them to gitignore, so that they won’t be committed in the repo, but you’ll have them for your local MAMP setup. If I’m not mistaken these files will anyway be added by MAMP, so you’ll only need to ensure you’re not committing files that should not get committed to a Git repo (such as backups, logs, etc.).