Unfortunately, the WordPress.org plugin repository doesn’t provide a way to maintain your plugin with Git. In the past, I’ve either just used Subversion, or hosted an extra copy on GitHub, and setup Git and SVN side-by-side in the same directory.
Awhile ago, I briefly considered using git-svn, because it would allow me to avoid using Subversion entirely, and do everything through Git. I dismissed the idea, though, because I thought that cloning even part of a repository with git-svn required scanning every commit in the entire repository, in order to build the local history. With almost 1.5 million commits in the plugin repository, that would take roughly 4 hours to clone a plugin.
I just noticed that git svn clone
has an optional --log-window-size
parameter, though, and it lets you determine how many log entries are scanned at a time. The default is 100
, but if you bump it up to 5000
, then it only takes a few minutes to clone the plugin, making git-svn a viable option.
git svn clone https://plugins.svn.wordpress.org/quick-navigation-interface/trunk quick-navigation-interface --log-window-size=5000
If you’re interested in digging into this more, Boone Gorges and Eric Mann both have detailed posts about it:
> The default is 100, but if you bump it up to 5000, then it only takes a few minutes to clone the plugin, making git-svn a viable option.
I am so glad I found this. Incredible tip. Thanks for posting! :)