vccw
vccw copied to clipboard
How to properly use vccw and git when developing a custom theme?
Operating System: Ubuntu 16.04 Vagrant Version: 1.9.1 Virtual Box Version: 5.0
I got a few stupid questions: Where do I initialize my git? Inside or Outside the box? Assuming outside the box: Why is the www folder in the .gitignore? That's the place where I develop my custom themes (www/wordpress/wp-content/themes to be fair) but the whole folder is not getting pushed so how do my coworkers get the changes on our custom theme?
I apologize for those basic questions but I got trouble understanding what the proper use of git in relation to the box is :( Also new to Vagrant and WordPress in general, please help.
+1 on this. I would say since the WP volume is synced, you could update gitignore and use GIT outside the box? But I am a Vagrant newbie as well.
Would love some tutorial on a basic use of Composer (install plugins via composer.json on provisioning), GIT, custom theme development + Bedrock structure if possible (should be).
I created an example repository. https://github.com/vccw-team/repository-example-of-wp I always commit our project like it.
I made just two customizations for example.
You can see themes and plugins has been committed by default. But upload files are not committed.
I know there are various opinions about this, but we are using .gitignore of the following repository as it is.
https://github.com/github/gitignore/blob/master/WordPress.gitignore
You can customize it according to your team's use case. :)
In this case:
- Team members can share the site with just
vagrant up. - Team members can deploy the site with Wordmove, if they have a SSH key.
This is a demonstration so it is a public repository, but it should be a private repository. ;)
VCCW runs provision-post.sh if it exists.
You can write shell script to customize the site and share it.
I do not know if this is the best, but it works fine as expected.
I'd like to improve documentation, but I am looking for someone to help me because there is not enough resources. :)
Thank you for your detailed answer! So in order to develop a custom theme as a team I need to dump the database each time changes were made to it and push the dump to git. If someone pulls the changes, a script needs to import the dump on his box? Am i right? I didn't find the .sh where you create the wordpress.sql file. I just see that you import it in provision-post.sh. Can you help me out on this one?
If someone pulls the changes, a script needs to import the dump on his box? Am i right?
Yes. You can import database wp db import /vagrant/wordpress.sql too.
And you can import db automatically when you run vagrant up with provision-post.sh.
https://github.com/vccw-team/repository-example-of-wp/blob/master/provision-post.sh
Actually, the plugin whose setting depends on MySQL DB is not very convenient. For example, Advanced Custom Field can save settings with JSON. It may be good to try to make workflow that is not dependent on the database as much as possible.