Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find files in source control but not in a Visual Studio solution?

I have a rather large Visual Studio 2008 solution in Subversion. It was migrated from Visual SourceSafe a few months ago. I'm starting to find that there are a number of files still in source control that were removed from the solution back when I was using VSS. They were probably renamed or deleted after they were checked out - VSS doesn't like that.

I'm looking for an easy way to find all of the files that are not in the solution but are in Subversion. Something like WinMerge's folder compare would be ideal, where one side is the Subversion working copy and the other side is the project contents.

like image 644
jrummell Avatar asked Nov 25 '09 15:11

jrummell


1 Answers

We haven't upgraded to VS2008 yet, so I'm not sure how much of this applies, but anyway:

Approach 1: On the Solution Explorer toolbar, click "Show All Files." Then highlight the root node of the solution and hit "*" on the numeric keypad to fully expand the tree. The icons that are just outlines are files that aren't part of the solution. From those, you have to determine by hand which are unnecessarily in svn.

Approach 2: Do a "svn export" to create a secondary copy of the project somewhere. Open the new copy with VS and then choose File->Source Control->Change Source Control. In the resulting window, if any projects show as "Connected," highlight them and click "Disconnect" on the toolbar. Close the Source Control window and then, in the Solution Explorer, with "Show All Files" turned OFF, delete everything. The files remaining on disk are the extras your project is no longer using.

With both approaches, it would be smart to make a separate backup copy of the project before doing anything, just in case you nail one too many files.

like image 140
Dewayne Christensen Avatar answered Oct 27 '22 06:10

Dewayne Christensen