Exclude file from source control

Exclude file from source control

  • Comments 2

When you need to exclude a file in a project from source control, you can select that file in the Solution Explorer window, then go to File > Source Control > Exclude [filename] from Source Control. A red icon should appear to the left of that file in the Solution Explorer window to tell you that it's excluded from source control. This option doesn't show up in the context menu of the file, just as other options that only show up in File > Source Control. Another way to do that is to add the file to the project, then undo the "Add" pending change for that file. It will remain in your project but it won't be added to Source Control.

Class1.cs is excluded from Source Control while Class2.cs is added to project but not added to source control.

Class1.cs is excluded from Source Control while Class2.cs is added to project but not added to source control.

Leave a Comment
  • Please add 8 and 4 and type the answer here:
  • Post
  • I do not have the "Exclude [filename] from Source Control" option in File > Source Control.  And yes the file was selected in the Solution Explorer.  I even opened it for edit after closing all other files.

    What versions of VS & VSS are you using?  (I am using 8.0 and 9.0, respectively)

  • What project type are you using?

Page 1 of 1 (2 items)