Discover File Changes Made Outside of Visual Studio


Overview

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.

Steps

  1. Visit the Visual Studio Extensions site for Team Foundation Server Power Tools (TFPT).
  2. Download and install the package.
  3. Once installed, open a command prompt.
  4. Navigate to the TFPT installation folder (where tfpt.exe is located).
  5. Run the “tfpt.exe online” and optionally include the following switches as needed.
    1. “/adds” will pick up any added files.
    2. “/deletes” will pick up any removed files.
    3. “/diff” will pick up any changed files.
    4. “/recursive” will look for changes through all sub folders.
    5. PATH is where to look for changes.

The complete command is as follows.

tfpt online /adds /deletes /diff /recursive PATH

Summary

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!

Advertisements

2 thoughts on “Discover File Changes Made Outside of Visual Studio

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s