Freigeben über


Exclude file from source control

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.

Comments

  • Anonymous
    July 24, 2008
    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)

  • Anonymous
    July 29, 2008
    What project type are you using?