TFS 2008 checks out code automatically on edit

后端 未结 7 2166
慢半拍i
慢半拍i 2021-02-09 22:10

I am working on a Visual Studio 2008 project that is already added to TFS server. I am not sure which settings and policies have been configured for the TFS (this is done by a s

相关标签:
7条回答
  • 2021-02-09 22:44

    You can remove binding to source control from file menu.

    0 讨论(0)
  • 2021-02-09 22:48

    It is in Options\SourceControl\Environment

    Checked out Items: Check out automatically

    change it to

    Checked out Items: Prompt for exclusive checkouts

    enter image description here

    or your preferred action.

    0 讨论(0)
  • 2021-02-09 22:57

    Unfortunately, with TFS it puts read-only locks on your files to PREVENT you from editing the file without checking it out first.

    I cannot stand this decision. What you'll have to do is allow TFS to check out the file, then "Undo checkout" on it later if you don't want to check it out.

    Make sure you have shared checkout enabled, exclusively locking files is the path to madness. ;)

    0 讨论(0)
  • 2021-02-09 22:57

    I think this is a feature not a problem. If you change a module and it's under source control, you are now "out of sync" with the repository. If you exit (and the default behavior is to save) - and come back later - the file is not what everyone else is seeing. This can be dangerous.

    For example: back in the days of VSS - on a Friday afternoon I had to "put out a fire" and debug a problem in, Prod Environment, so I changed the connection string in the appropriate config file. Another developer had the file checked out - so I did the usual workaround to mark the file read-only so I could save it. I figured out the problem and informed the user. This was in fire-fighting mode - so I didn't consider the fact that I now have production connection string in my dev configuration.

    Monday mornign I come in and open up the solution. Is there any feedback telling me the config file is pointing to production? No I have to remember.

    If the file is checked-out however - that icon is indicator to me that "flags" the fact that the files have been modified. I don't quite understand the "big deal" in having to right-click the solution and say "un-do pending changes"

    Or if you want to save them, as the down-voted suggestion by aleichtle.wordpress (I don't understand the down votes - I think it is an excellent suggestion) explains, you can shelve the changes. This will remove the check-out and also save the changes on the server.

    Version Control systems are a critical and important component of the software development life cycle. It is important to consider your "process". You may need to make adjustments as you use a different tool ("When in Rome"....)

    It may be difficult to make the adjustment - but there are often good reasons the tool works the way it does.

    0 讨论(0)
  • 2021-02-09 23:03

    I'm running Windows 7 and VS 2010. From Windows Explorer, you can - right-click on your project's main folder - Choose Team Foundation Server - Choose Workspace - Remove the active Working Folder (bottom of the screen).

    I belive this removes the bindings to TFS, and you're free to wreak havoc on your code at will.

    0 讨论(0)
  • 2021-02-09 23:04

    You can make a shelveset of the code allowing you to make a change to the code without affecting the rest of the development.

    You can do this by right clicking on the file and selecting shelve pending changes.

    0 讨论(0)
提交回复
热议问题