I know this question has been asked a thousand times, but I'm really trying to work out how to get the best out of Git when working with WordPress.
I've scoured the web and read dozens of articles, all that seem to cover the topic briefly. Here's a few of the most notable one's I've read recently.
Currently, my workflow looks like this.
- Install WordPress locally
- Develop Theme
- Export WordPress Databases from local server
- Import WordPress Database to remote server
- Upload WordPress files and theme via FTP
- Client makes changes
- Download WordPress files and theme via FTP and export WordPress Databases from remote server
- Replace files locally
- Make development changes
- Re-upload via FTP, export and import database to remote server
I realise Git can streamline this process. It seems the best way to do this is to have a .gitignore file that ignores certain directories that don't need to be tracked, as well as having both a local and remote wp-config.php file.
But how do you handle the databases? Clients will usually make changes (posts/pages/plugins). Do I still need to export from the remote database and import back on my local server?
Can someone suggest the best workflow for me here? And walk me through the steps.
Also, I'd probably like to use Bitbucket as private repos with them are free, unlike GitHub.
Any help would be appreciated.
Thanks in advance!