Skip to content

How to convert a VSS project to git?

Published:

In one of my jobs, all version control was running on VSS when I arrived. Microsoft Visual SourceSafe. I didn’t know about it before and I have to say that it’s not necessarily easy to fall back on older version control software if you are used to git. Especially the fact that files and projects can be checked out and only one developer can work on them at a time drives me crazy compared to what I’m used to.

Rather fast we could agree to move the old projects to git. But is that complicated? And how do you do it?

First, of course, there should be a remote repository. In our case, we set up our own gitlab instance on a Synology NAS using Docker and set it up for our needs. For the first project I wanted to move, I started by creating an empty repository.

To avoid losing the version history that was maintained via VSS for years there is a tool you can use. I used this one here for our move: https://github.com/trevorr/vss2git.

I think it is quite important to make a copy of the VSS database before using this tool. As already mentioned, VSS is a central version management unlike Git. If something goes wrong during the migration, you can not simply revive the repository from the machine of any developer.

The copy of the VSS database is now given to the vss2git tool and all options in the tool are set to select the one project you want to convert. Then you can start the process.

In the output folder you will find a local git repository that should contain all information from VSS. I always checked this again by comparing all files for differences to the project checked out from VSS. You can also roughly scroll through the version history once in git and once in VSS to see if there were any problems.

Finally the remote repository created in the gitlab at the very beginning has to be linked to the local git repository of the project. Then the project can be pushed and it is now located as a git project on gitlab. In my case, it is also important to note that the version number had been set as tags in VSS. Usually git doesn’t push them, so you have to set an extra flag in the push command.