guy labs guy labs

How to convert a SVN repository to GIT in Linux

Development, Linux
/by
Today we want to convert a SVN repository to a GIT repository. I did the same conversion at edorasware too. What you need is direct access (SSH access to the server where the SVN repository lies) to the SVN repository which you want to convert and have GIT installed on that server. If you do this on a production SVN repository you need to tell all developers to stop committing while you are doing the conversion to prevent an inconsistent state of the GIT repository. Let's start by creating a dump of the SVN repository. (be sure you have enough disk space) Browse to the repository and execute the following command: Now we have a dump of the repository which you can copy into a temporary folder where the conversion takes place. Next we create an empty SVN repository and load the dump into this repository. Execute the following commands to do this: This process leaves the original SVN repository intact such that you can go back to SVN if something happens while converting. Next we need to download the svn2git tool which was used to convert the SVN repositories from the KDE project to GIT. Execute the following commands to clone the GIT repository: Now we need to install some dependencies in order to make the svn2git executable. Install the libsvn-dev dependency and qt4. In ubuntu you would execute the following commands: After the installation browse to the svn2git folder and execute the following commands to make the executable: After this process you have the svn-all-fast-export executable inside the...