Thursday, August 26, 2010

.Net Studio Trick - How to check out only modified source files when rebinding the project to the source control

Commonly software is developed in a source controlled environment such as team foundation server, but sometime its not applicable , the classic scenario is when two developers are working simultaneously with the same source files for two different projects which takes a while to finish , agreeably or not , one of them will need to develop his project offline and unbind from the source control server , after the project completion he binds it back the source control then check out the modified files and merge the source code then checks in his project changes - mission accomplished!
I have been there , and the problem I faced in this process is to remember what files to check out after binding the project , its not always easy to remember when its a big project when you have modified 8 source files out of 220 , if you missed one you are risking checking in partial source or worse you may override and lose your modified sources when syncing your machine with the source control as it replaces your sources with server's ones.
I found a quick way to checkout only the modified source files when rebinding the project to the source control without remembering the files names ,i will illustrate how to do it using the following example project :


Step I: Bind the project and checkout all the files


Step II: On the project file Right click and choose to "Undo Pending Changes.."


Step III: A dialog pops up warning about discarding changes , press "No to All"

The result :


Vaulla !  only my modified files is checked out , you can do this trick to entire project solution containing lots of projects and source file !

Please be aware to choose the "No to All " in the undo pending changes pop up and not any other option which may override your changes.

Enjoy :)

No comments:

Post a Comment