James in Indy
James in Indy

Reputation: 2884

How to check in mass changes into TFS

I have a situation where a developer made mass changes to a project outside of TFS (long story), and now we want to put those changes back into TFS (files added, removed, renamed).

Of course, TFS is not like Git; if I check out the project, then delete the files from the workspace and copy over the new files, TFS won't adapt to those changes.

I have discovered that I can do a Compare from File - Source Control, and that the Compare screen allows me to mark files as added/deleted. This helps, but is a slow process for a large project, and quite prone to human error.

So, my question is: Is there an automated way to get TFS to simply add all new files and remove all deleted ones?

Upvotes: 2

Views: 325

Answers (3)

James in Indy
James in Indy

Reputation: 2884

Since I did not get to try the above suggestions, I'll post the workaround I did, in case it helps anybody else. Hopefully, the above suggestions are better than what I ended up doing.

  • Make sure nothing is checked out
  • Open solution
  • Team - Go Offline
  • Close solution
  • Windows Explorer - Copy latest source folder into the current source folder (Windows Explorer will do a Merge).
  • VS - Open solutin, select solution file
  • File - Source Control - Advanced - Change Source Control
    • if you get a message about unloaded projects, make sure all projects loaded. Click "Reload" on those that didn't.
    • Shift to select all project, click Bind
  • Do a Compare in Source Control Explorer. Manually add all new files. Manually delete all deleted files. Frown.

Upvotes: 0

PerryC
PerryC

Reputation: 1281

You might try using tfpt online. I would add the /adds /deletes /diff /recursive flags as well.

I think in almost any case you will have some conflicts/manual work to do here.

There is a blog post on a possibly similar situation that used tfpt online as well: Discover File Changes Made Outside of Visual Studio

Upvotes: 2

rerwinX
rerwinX

Reputation: 2035

If you are using a Local Workspace then you should be able to get latest on the workspace, then copy over all the new files in Windows Explorer which will generate pending changes and file adds.

If you go into Pending Changes in Team Explorer you will have lots of detected changes for new files etc. but you can promote them to included changes.

This isn't going to deal with file renames or deletions though so it might not be the best solution.

Alternatively you could use Reconcile Changes in Version Control

  1. In Source Control Explorer, right-click a folder, and then click Compare.
  2. In the Compare dialog box. select the folder versions to compare.
  3. In the Folder Difference window, right-click the folder or file you want to reconcile, and click Reconcile.

This will allow you to choose what to add or change to version control

Upvotes: 2

Related Questions