I recently had an issue where I had to rollback an entire branch in TFS and then hand apply a whole mess of changes. There were entire sub-branches that needed to remain the latest version and other files that had to be hand edited. Overall it was a large job.
In an effort to speed up the process for those folders that needed to remain as the latest version I decided to work outside of Visual Studio and TFS. I manually removed the rolled back versions of the folders and copied the folder from a backup I’d made before rolling back into the appropriate location in my local source control folder. The only problem was that Visual Studio / TFS didn’t recognize that a change had been made.
Here’s how you get those changes made outside of Visual Studio to be recognized as changed in Visual Studio.
- Visit the Visual Studio Extensions site for Team Foundation Server Power Tools (TFPT).
- Download and install the package.
- Once installed, open a command prompt.
- Navigate to the TFPT installation folder (where tfpt.exe is located).
- Run the “tfpt.exe online” and optionally include the following switches as needed.
- “/adds” will pick up any added files.
- “/deletes” will pick up any removed files.
- “/diff” will pick up any changed files.
- “/recursive” will look for changes through all sub folders.
- PATH is where to look for changes.
The complete command is as follows.
tfpt online /adds /deletes /diff /recursive PATH
This has allowed me to pick up all of those changes I made outside of the IDE and apply them to TFS as usual. One thing I noticed though is that even folders such as bin, obj, Debug, etc. will be picked up. You will need to make a determination yourself as to whether you want these included in your source control.
I hope this helps!