How can I always block checkin of a specific file in TFS

前端 未结 8 1859
隐瞒了意图╮
隐瞒了意图╮ 2020-11-28 04:18

There is one file that I always made changes to, but that I never want to be checked in. I would like TFS to block me from ever checking it in or committing the changes. H

8条回答
  •  没有蜡笔的小新
    2020-11-28 04:20

    There are 2 ways.

    1. You can "Uncheck" it in the "Pending Changes" window, it should then remember this next time you load Visual Studio. This is a bit cumbersome if you like to "select all" and Check/Uncheck the items in the list and prone to error.
    2. Don't "check-out" the file, go into Explorer and remove the Read-Only attribute yourself. Then edit the bits you want. The caveat is, that TFS doesn't know about it and doesn't always update the file correctly. Also, if you edit that file in VS (for anoter change), it will be "checked out" and you may then check it in by mistake.

    I don't like either option in TFS / VS 2010, so I actually avoided doing this (I used to have a large "ignore-on-commit" when we used SVN). Now I am using VS11 Beta, the Excluded list does exactly what I want, I move something to it and it stays there, and I can easily put other changes on and off that list and not checkin that file.

提交回复
热议问题