How to add a header image to my WordPress plugin using git-svn?

I’m trying to use the header image customization trick that allows a wordpress plugin developer to display a customized header image on his WordPress directory plugin page.

For that, I need to create a “assets” directory in my plugin root directory under svn (at the same level than trunk and branches), and put my image there. You can see the structure in place for SEO by Yoast plugin. The problem is that I want to achieve this using git-svn, not svn.

Read More

I have setup a git/svn repo and successfully pushed on svn trunk and even created a tag. I can see that the assets directory has been created for me on the svn repo, but I cannot figure out how to add a file on the directory.

The issue is that the “assets” directory is outside the svn standard layout and cannot be reached by branching. I think I will have to specify a non-standard layout somehow ?

Related posts

Leave a Reply

1 comment

  1. Late to the party, but hope this helps someone.

    You can do this, but you’ll need to manage the assets folder on a separate branch.

    This will allow you to push changes to http://plugins.svn.wordpress.org/{plugin}/assets directly by setting up a seperate remote.

    Assuming you already have your plugin setup locally under git svn create a new config for the assets url;

    $ git config --add svn-remote.assets.url http://plugins.svn.wordpress.org/{plugin}/assets
    $ git config --add svn-remote.assets.fetch :refs/remotes/assets
    $ git svn fetch -r HEAD assets
    $ git checkout remotes/assets
    $ git checkout -b assets
    

    You’re now on a new branch called assets that contains only the assets folder contents. Make your edits, commit, then use git svn dcommit to push your assets folder up.

    Then simply switch back to your master branch, you’re all done.