How to customize a WordPress plugin and upgrade

Sometimes you want to make minor changes to WordPress plugins that no body except your self would want. Then comes the issue of upgrading to new versions of the plugin. git-svn is the perfect tool for this. It has all the cool features of the distributed SCM git and ability to pull from subversion (and push to it as well). Here is how I do it:

  1. Clone the trunk
    git svn clone http://svn.wp-plugins.org/web-invoice/trunk/
    
  2. Make your changes
  3. Commit changes locally
    git commit -a
    
  4. Pull new changes (e.g. new release). Git is very good at merging, you will not have conflicts unless you edit exact same lines in the local version. Still a manual merge shouldn’t be too complicated
    git svn rebase
    

In the example I have taken the svn trunk of Web Invoice WordPress plugin. Hope you find this information useful next time you hack a WordPress plugin.

Subversion to Git

My new year resolution was to ditch Subversion and move to Git. I switched to Git as my SCM for all my development work on new year day it self. I did hit some issues because my ignorance about how things are done with Git, however everything was fixed within the day. Now, 20 days later; I’m really happy that I did make the switch. Git has reduced development time greatly. No longer do I think about whether I should commit, wait for commit to finish for many minutes, or worry about overwriting someone’s work. Now I spend more time doing actual development than thinking about planning merges and commits.

I’ll blog about the few gotchas that I faced when I have time, hopefully soon. Development is fun again, thanks to Git. 🙂