I haven't used Subversion in years, and while I have done a lot of WordPress plugins over the year for work, they were all private and we never shared them on the registry.

I prefer to use git. I knew it had a svn sub-command however I've never used it. I spent the better part of a day trying to figure out how to push to WordPress's Subversion from git.

I tried to follow several guides but I kept getting Unable to determine upstream SVN information from working tree history, I spent hours googling it, eventually I came to the conclusion I have to use a different branch.

I thought I'd share this. might save someone few hours of frustration.



Notes :

I'm not sure how this would work if multiple people are pushing to svn, I'd use git and only one person pushes to svn.

Initial Setup --> git init ooo-nospam/ Initialized empty Git repository in /tmp/ooo-nospam/.git/ --> cd ooo-nospam # The --no-minimize-url --stdlayout options are *VERT* important --> git svn init --no-minimize-url --stdlayout --prefix=wp-svn/ https://plugins.svn.wordpress.org/oneofones-nospam/ --> git remote add github git@github.com:OneOfOne/ooo-nospam.git --> git remote update github Fetching github --> git pull github master # Create an empty orphan bracnh to be used by svn-only --> git checkout --orphan svn # Clean all the files from the master branch --> git rm -rf . rm 'README.md' rm 'ooo-nospam.php' rm 'readme.txt' # Find out the earlist revision to use for our clone, usually it's the assets one |---> svn ls -v https://plugins.svn.wordpress.org/oneofones-nospam/ 887507 OneOfOne Apr 04 15:10 ./ 887134 plugin-m Apr 04 02:52 assets/ #note the 887134 887134 plugin-m Apr 04 02:52 branches/ 887507 OneOfOne Apr 04 15:10 tags/ 887475 OneOfOne Apr 04 13:31 trunk/ --> git svn fetch -r 887134:HEAD --all r887134 = 25565f9dd1f11e52d3ea6eb6892577385e053ae4 (refs/remotes/wp-svn/trunk) A readme.txt A ooo-nospam.php .............more stuff............. Checked out HEAD: https://plugins.svn.wordpress.org/oneofones-nospam/trunk r887475 # Switch back to git master --> git checkout master 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 -- > git init ooo - nospam / Initialized empty Git repository in / tmp / ooo - nospam / .git / -- > cd ooo - nospam # The --no-minimize-url --stdlayout options are *VERT* important -- > git svn init -- no - minimize - url -- stdlayout -- prefix = wp - svn / https : / / plugins .svn .wordpress .org / oneofones - nospam / -- > git remote add github git @ github .com : OneOfOne / ooo - nospam .git -- > git remote update github Fetching github -- > git pull github master # Create an empty orphan bracnh to be used by svn-only -- > git checkout -- orphan svn # Clean all the files from the master branch -- > git rm - rf . rm 'README.md' rm 'ooo-nospam.php' rm 'readme.txt' # Find out the earlist revision to use for our clone, usually it's the assets one | -- -> svn ls - v https : / / plugins .svn .wordpress .org / oneofones - nospam / 887507 OneOfOne Apr 04 15 : 10 . / 887134 plugin - m Apr 04 02 : 52 assets / #note the 887134 887134 plugin - m Apr 04 02 : 52 branches / 887507 OneOfOne Apr 04 15 : 10 tags / 887475 OneOfOne Apr 04 13 : 31 trunk / -- > git svn fetch - r 887134 : HEAD -- all r887134 = 25565f9dd1f11e52d3ea6eb6892577385e053ae4 ( refs / remotes / wp - svn / trunk ) A readme .txt A ooo - nospam .php . . . . . . . . . . . . .more stuff . . . . . . . . . . . . . Checked out HEAD : https : / / plugins .svn .wordpress .org / oneofones - nospam / trunk r887475 # Switch back to git master -- > git checkout master