There are already special tools for this (e.g. svn2git). https://github.com/nirvdrum/svn2git Why reinvent the wheel?