I’ve seen a hundred different outdated, makeshift scripts that either use git-svn or do all of the hard work behind the scenes, but I still don’t feel like I’ve found the right way to do this.
I have a local git repo that I want to deploy to my WordPress-hosted SVN repo. The ideal functionality would be that I develop locally, push to github when I’m ready, then send all of the changes I’ve made to the wordpress repo.
My remote wordpress repo would update accordingly, removing files and folders that may not longer exist due to refactoring and tagging the branches accordingly. My github repo should act as usual, tagging the incoming versions.
https://github.com/deanc/wordpress-plugin-git-svn
http://danielbachhuber.com/2010/09/29/how-to-properly-use-git-with-wordpress-org-subversion/
Well, there is no one good way to do this. However, here is a suggestion.
What you can do is create a bare repository on your server, outside the public directory. This repository will push changes to your SVN repository and will be like the gate keeper for your SVN repo. Your website already runs an SVN repository.
You can use a shell script, something like https://github.com/deanc/wordpress-plugin-git-svn on the post-commit hook on this bare repository.
I have taken this from https://github.com/deanc/wordpress-plugin-git-svn/blob/master/deploy.sh but you can get the git commit message directly instead of asking for one.
On your local machine, add the bare repository as a remote and push changes to it:
How this works is, you write some code and push it to the bare repository, which using its post-update hook to push changes to the SVN repo.
You will have to modify the code above to push changes. I have just given a reference.