TFS out of sync between local and remote - how to "re-sync"?
Asked Answered
B

4

8

I have a Project on CodePlex which is using TFS and I am using the TFS Plugin for Visual Studio. Now I have copied this project and worked on another PC without TFS and done some refactoring. Foolishly, I have then just used copy/paste and manual text editing to merge my changes, expecting that TFS just picks up the changes.

Apparantly, that is not the case. Here is a screenshot of my local directory: My Local TFS http://img259.imageshack.us/img259/2897/tfslocal.jpg

Notice how some files are missing the lock symbol - those are missing. If you look at the current TFS Tree on Codeplex, there are some files which do not exist locally anymore, i.e. WikiPlexExtensions.cs in the main folder.

Is there any way to easily tell TFS to compare my local to the remote repository and pick up the changes? I could re-add the local files using "Exclude from local project" and re-adding them, and I could create the "deleted" files as empty files just to delete them, but if I can avoid the manual messing around that would be good as well :)

Begun answered 3/8, 2009 at 19:11 Comment(0)
K
4

The easiest way is to exploit VS 2008's "online" feature. Basically you want to set your solution offline, then bring it online while connected to the proper Codeplex server. TFS should figure out the rest.

Keratinize answered 3/8, 2009 at 19:17 Comment(1)
Thanks! Both your and Mehment's Answer are really helpful. I've accepted yours because that was what I just did to solve the conflict :)Begun
O
2

To compare local and server folders, you can check out TFS Power Tool. After installing it, you can bring up the source control explorer, right click on the server folder and then select 'Compare'. Folder difference window will display the differences. You can also right click on the differences to see available commands such as 'Get Latest' to update your local folder for example. Check out Bryan Harry's blog post on the power tool

Overland answered 3/8, 2009 at 19:26 Comment(0)
C
0

I don't think there is an easy fix... What I've done in the past is back up those files that I have edited, then do a "Get Latest Version..." for the files I edited. This should change the files back to being read-only etc... Now, check out the files the regular way and paste the backups you had into the checked out files. Obviously this really only works when there are a couple of files you have edited.

Centreboard answered 3/8, 2009 at 19:17 Comment(2)
Get will not make files read-only unless you select the /overwrite option. Of course, this will also wipe out your changes. If you leave the default option, you'll have a writable file conflict which can be resolved "checkout and auto merge." This does work, it's just slow...and it doesn't pick up files that have been added or deleted. (or renamed, but that's an impossible task not even tfpt attempts)Keratinize
Yeah, I just overwrite most of the time (hence the backing up that I mentioned) but you are right there is a better way.Centreboard
U
0

TFS (in Visual Studio) has a "Reconcile" command for this, see Microsoft documentation, or this answer with steps.

BTW: This command may not haven been existing at time of original question, but this question came first when I was searching.

Unpaged answered 18/10, 2019 at 8:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.