Re:Git Management for WordPress
by paultannenbaum on Tuesday July 01, 2014 @09:08PM
(#7974512)
Wordpress is less than ideal for managing via git, primarily due to their plugin architecture. The best way I have managed to use git is to put the repo at the wp-content level and only watch the theme and plugin directories. Then anytime I make updates to a plugin or group of plugins, I make sure to commit those changes as a seperate commit to what I am normally working on. It is tedious and hacky, but it at least gets me basic version control functionality with the ability to roll back on any code that can effect theme functionality.
Re:Git Management for WordPress
by rwhitman on Tuesday July 01, 2014 @09:21PM
(#7974564)
This is my workflow as well. Not ideal, but better than nothing.
Though I will say the biggest pain point with Wordpress is syncing and merging DB changes amongst team members, since so much of WP configuration is stored in the DB this becomes a real point of frustration especially on very large sites. I'd peg that problem as a much higher priority in terms of WP workflow than how to manage git inside WP admin.
Re:Git Management for WordPress
by nader on Wednesday July 02, 2014 @06:07AM
(#7976060)
this is a massive problem with all kinds of CMS including Drupal which we are using often. Drupal 8 is introducing configuration management, i.e. saving database configuration in yaml files which makes them "gittable". I hope wordpress and other CMS will also adopt this or a similar way.
Re:Git Management for WordPress
by LordIllidan on Wednesday July 02, 2014 @07:07AM
(#7976217)
The Features module in Drupal 7 is a semi-workaround https://www.drupal.org/project/features
but I've hated Drupal a lot because of this. Too much stuff is stored in the DB.
Re:Git Management for WordPress
by brokentone on Tuesday July 01, 2014 @06:19PM
(#7973825)
It seems as though it works in reverse from a normal git setup--items which get changed on the server directly through say a UI initiated upgrade can be tracked and reverted in GIT from a dashboard. Kinda cool for single server installs.
Storing the DB state in GIT is going to be an issue with a site of any substance.
Re:Git Management for WordPress
by USNetizen on Tuesday July 01, 2014 @11:03PM
(#7974900)
I've done this before (though not using this solution), and I'll never do it again. Managing Wordpress (and the database backups) with Git causes ENORMOUS history files over time, to the tune of many gigs on the server depending on the size and configuration of the site. It isn't worth it. Perhaps only monitoring a couple directories (such as plugins) would be better, but too limited for a serious whole-framework solution.
Re:Git Management for WordPress
by aikah on Tuesday July 01, 2014 @08:29PM
(#7974388)
Wordpress in next to not manageable with git anyway in my experience.The plugin system is totally broken when it comes to versioncontrol. Anything added to wordpress might f.. up the db or the cms itself.
Wordpress codebase is f.ed up, ugly, badly architectured yet this is the most popular CMS and its ecosystem is huge.
It's amazing and scary.
Re:Git Management for WordPress
by woah on Tuesday July 01, 2014 @11:00PM
(#7974890)
You sound like you may not know how to do it. I manage a medium-large sized site with Wordpress and git and it works great. Why would you ever try to check plugins into git? You are not supposed to touch anything outside of your theme folder. I have never had any issue updating anything.
Re:Git Management for WordPress
by nuetrino on Thursday July 03, 2014 @05:24AM
(#7982180)
I guess I view this separation as an adaption of The Single Responsibility Principle. This is how I view themes & plugins, and their relationship. Your theme is used to display your site, it's navigation, content, it controls the markup browsers see.
Plugins are for adding functionality to your site, if you want a sitemap, there's a plugin for that. Not happy with your current sitemap? Install/Create a new plugin, replacing the old one. If your sitemap isn't working, where do you look? Your sitemap plugin's code.
The importance of having this separation of tasks, removes a lot of risks too in my opinion. If your site isn't working instead of risking having to change your theme, you can deactivate the troublesome plugin. Albeit finding the offending may be difficult, but at least you're not changing the total design of your site.
Hence why I believe in plugins and themes having distinct tasks. It really helped me organise the development, and maintenance of sites.
Re:Git Management for WordPress
by pea on Wednesday July 02, 2014 @05:56AM
(#7976038)
Great job: making Git work outside it's familiar environment is a headache, but such an important problem to solve. It looks like they are some point on the way to doing it with Wordpress, so all the props to them. Keep on keeping on and don't let the naysayers get you down!
Though I will say the biggest pain point with Wordpress is syncing and merging DB changes amongst team members, since so much of WP configuration is stored in the DB this becomes a real point of frustration especially on very large sites. I'd peg that problem as a much higher priority in terms of WP workflow than how to manage git inside WP admin.
http://forumone.com/insights/configuration-management-finall...
https://github.com/forumone/wp-cfm
Storing the DB state in GIT is going to be an issue with a site of any substance.
Thankfully there was a deploy.sh script on github [1] which could be used to deploy your plugin from git repo straight to wordpress.org's SVN repo. :)
[1] https://github.com/pdclark/deploy-plugin-to-wordpress-dot-or...
Uh, what? Any medium/large site inevitably ends up with a few custom plugins.
Plugins are for adding functionality to your site, if you want a sitemap, there's a plugin for that. Not happy with your current sitemap? Install/Create a new plugin, replacing the old one. If your sitemap isn't working, where do you look? Your sitemap plugin's code.
The importance of having this separation of tasks, removes a lot of risks too in my opinion. If your site isn't working instead of risking having to change your theme, you can deactivate the troublesome plugin. Albeit finding the offending may be difficult, but at least you're not changing the total design of your site.
Hence why I believe in plugins and themes having distinct tasks. It really helped me organise the development, and maintenance of sites.
Here's a pretty decent setup for using git with WordPress too. https://github.com/markjaquith/WordPress-Skeleton
http://en.wikipedia.org/wiki/Single_responsibility_principle
Versionpress sound like they're going to try something a bit smarter with the database file though.