Over a million developers have joined DZone.

Undo Checkout for Unchanged Items in TFS

· Agile Zone

Learn more about how DevOps teams must adopt a more agile development process, working in parallel instead of waiting on other teams to finish their components or for resources to become available, brought to you in partnership with CA Technologies.

The pending changes list of TFS is a lie. It shows all files checked out for edit, not those with actual changes. A TFS power tools command can save the day.

A key factor of successful source control usage is to always review pending changes before check in. Without reviewing the pending changes it is far to easy to have unrelated changes slipping in with the commit.

Working with TFS, reviewing pending changes can be a pain because of the check out before edit model. Any file that has been touched, even with all changes undone, is listed as a pending change. I’m currently working with a large Entity Framework model where hundreds of files are regenerated on each change, even if only one of those files is actually updated with new content. Finding the actual changes among hundreds of false entries in the list is impossible.

The saviour is part of the TFS power tools (I can’t understand why it’s a separate add on and not part of the core TFS client.

tfpt uu . /recursive /noget

Using the command daily, I’ve found a couple of gotchas that are good to be aware of:

  • Always save all files in visual studio first. If visual studio tries to save a file that it thinks is checked out and writable and it isn’t, it is very easy to loose data, especially in the project files. Always hit save all (Ctrl+Shift+S) first.
  • It only affects the current directory and subdirectories (exclude sub directories by omiting the /recursive switch.

Discover the warning signs of DevOps Dysfunction and learn how to get back on the right track, brought to you in partnership with CA Technologies.

Topics:

Published at DZone with permission of Anders Abel, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}