How to remove Visual Source Safe binding from Visual Studio projects?

January 19th, 2012 | by | technology

Jan
19

Just wrote this script to remove the VSS source safe bindings from old visual studio projects, so that I can move to GIT repository. I just run these commands using the Cygwin shell, from the solution root folder, and it removes all traces of the source control of the Jurassic era.

find . -type f -name *.dsp -print0 | xargs -0 -r perl -p -i.vssbak -e 's/^.*Scc_ProjName.*$//g'
find . -type f -name *.dsp -print0 | xargs -0 -r perl -p -i.vssbak -e 's/^.*Scc_LocalPath.*$//g'
find . -type f -name *.dsw -print0 | xargs -0 -r sed -i '/begin.source.code.control/,/end.source.code.control/d'
find . -type f -name *.sln -print0 | xargs -0 -r sed -i '/GlobalSection(SourceCodeControl)/,/EndGlobalSection/d'
find . -type f -name *.*proj -print0 | xargs -0 -r perl -p -i.vssbak -e 's/^.*SccProjectName.*$//g'
find . -type f -name *.*proj -print0 | xargs -0 -r perl -p -i.vssbak -e 's/^.*SccLocalPath.*$//g'
find . -type f -name *.*proj -print0 | xargs -0 -r perl -p -i.vssbak -e 's/^.*SccProvider.*$//g'
find . -type f -name *.vssbak -print0 | xargs -0 -r rm -f
find . -type f -name *.*scc -print0 | xargs -0 -r rm -f

Now its easy, to create a GIT repository on top of it.

git init

Authored by

Leave a Comment