locked
Exclude files from TFS 2012 Source Control RRS feed

  • Question

  • I have searched a LOT around regarding this issue. I know i can create Check-in policies with Power Tools (absurdly hidden and unnatural), i know i can drag whatever file i want to the "Exclude Changes" section on the Pending Changes window (manually, every time i want to do a Check in) and i even saw a few solutions where i could edit some windows key files.

    What i couldn't find is a normal and good reason of why isn't possible to simply select a few files or folders so that TFS just ignore them when searching for changes before a check in.

    We have several projects on our TFS environment, of several different platforms. There are files that change accordingly to the developer's workspace, local files location and such, that were first necessary to be checked in but afterwards shouldn't be altered anymore.

    And today we have to manually exclude them every time! We created some policies to avoid them being checked in but honestly, why must this be so "manual"? Why the "Exclude from Source Control" option was removed from the File menu? Why isn't there a similar option just one "left-click away" in the source control?

    What is the problem to attend such requested functionality (as seen by a simple "TFS 2012 ignore file" search on Google)?

    Friday, August 2, 2013 3:54 PM

Answers

  • Hi William_Satoru,

    Firstly, I am very sorry to hear that you encountered this issue when you are working with TFS Source Control.

    And as far as I know that TFS Source Control is mainly used to store "source" code resouce. So if you do you not want to track version history of these special files, you can consider not putting them in TFS Source Control.  

    In addition, you can avoid excluding these files manually every time when you check in pending changes by not including the folder contains these files when you check in.

    For example, maybe you have the folder structure in your TFS Source Control like this:
    -Solutions
      -WebSiteProject
        -Home.aspx (has pending changes)
    -Folders (contain these files with pending changes)
      -Files (change according to developer's workspace, and etc.)  

    At this time, if you right-click the Home.aspx file and choose Check In, the pending changes in the Files folder I high-lighted above will be excluded automatically.

    Thanks.


    Vicky Song
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, August 5, 2013 2:03 PM
    Moderator
  • When you click on "Detected Changes" in the Team Explorer pane, "Promote Candidate Changes" window opens. This window allows you to select among detected changes and promote them to a source controlled item.

    In this "Promote Candidate Changes" window, you select a file (or multi select files with Shift), right-click on it and a context menu pops up which contains an "ignore this local item" option. If you you click on it, selected files are excluded from source control.

    Visual Studio adds a file named ".tfignore" to the source control mapping root, which contains names of all files to be ignored by source control. (Previous TFS versions did not produce this file but they were all server workspaces. Since this is a "Local" workspace, filenames to be ignores need to be kept in the workspace)


    Cheers KSR

    Tuesday, August 6, 2013 6:44 AM

All replies

  • Hi William_Satoru,

    Firstly, I am very sorry to hear that you encountered this issue when you are working with TFS Source Control.

    And as far as I know that TFS Source Control is mainly used to store "source" code resouce. So if you do you not want to track version history of these special files, you can consider not putting them in TFS Source Control.  

    In addition, you can avoid excluding these files manually every time when you check in pending changes by not including the folder contains these files when you check in.

    For example, maybe you have the folder structure in your TFS Source Control like this:
    -Solutions
      -WebSiteProject
        -Home.aspx (has pending changes)
    -Folders (contain these files with pending changes)
      -Files (change according to developer's workspace, and etc.)  

    At this time, if you right-click the Home.aspx file and choose Check In, the pending changes in the Files folder I high-lighted above will be excluded automatically.

    Thanks.


    Vicky Song
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, August 5, 2013 2:03 PM
    Moderator
  • When you click on "Detected Changes" in the Team Explorer pane, "Promote Candidate Changes" window opens. This window allows you to select among detected changes and promote them to a source controlled item.

    In this "Promote Candidate Changes" window, you select a file (or multi select files with Shift), right-click on it and a context menu pops up which contains an "ignore this local item" option. If you you click on it, selected files are excluded from source control.

    Visual Studio adds a file named ".tfignore" to the source control mapping root, which contains names of all files to be ignored by source control. (Previous TFS versions did not produce this file but they were all server workspaces. Since this is a "Local" workspace, filenames to be ignores need to be kept in the workspace)


    Cheers KSR

    Tuesday, August 6, 2013 6:44 AM