This was a script to migrate a Git repository to SVN preserving the commits history. I updated it to use on HUBzeroas a no hack too cheap way of pulling in data from Git repositories to our internal Subversion repositories. It only pulls the most recent code from the Git repo and no longer preserve all of the commit history. It does clone the Git repository and perform a commit to the Subversion repository using credentials stored in a hubconfiguration.php file that the user can supply the path to.
./git2svn.sh [options]
-g <url> – clone the Git repository at https <url>
-s <url> – commit to the Subversion repository at <url>
-c <path> – use the credentials stored in the configuration file at <path>
-r <path> – store temporary repositories in the <path>
Temporary directories will be created, in the caller’s home directory, to store the Git and Subversion repositories.
They will be deleted after a successful commit.
If a project name is provided instead of an Subversion repository, the script will make a guess at the subversion repository url.
./git2svn.sh -g https://github.com/codedsk/helloworld.git -s https://hubzero.org/tools/h20161017/svn/trunk -c ./hubconfiguration.php
./git2svn.sh -g https://github.com/codedsk/helloworld.git -s h20161017 -c ./hubconfiguration.php