Hi, I need a way to force a branch in TFS to update itself to exactly match what is in the working folders. I need something that will delete files that are on the server but not in the working folders, add files to the server that are only in the working folders, and update the changed files by using the exact version that is in the working folders. I need this to be form the command line or the API’s and not a manually in the UI.
Does anyone know of any way to do this?
views:
739answers:
1
+2
A:
tf undo $/ /r
tfpt online /adds /deletes /diff /noprompt
tf checkin /comment:"synchronizing" /noprompt
Get tfpt here if you don't have it already: http://msdn.microsoft.com/en-us/teamsystem/bb980963.aspx
Richard Berg
2009-07-22 19:56:02
Thanks for your answer Richard, i had high hopes for it (and still do), but I'm running into some issues with it. The first problem is if i run the tfs command as written there, i always get the "Unable to determine the workspace" error (100). The only way I've found around that is to use an item spec in the command line that points to the working folder that i want to check in. so liketfpt online /adds /deletes /diff /noprompt c:\tfs\v1do i have something wrong that i need the itemspec?Thanks
John C
2009-07-24 12:47:49
All TFS command lines have some logic to determine which server to use. If there's only 1 server in your cache, they should use that. If not, you need to 'cd' to a directory that uniquely identifies a workspace (either it's mapped, or its children contain mappings to exactly 1 workspace). Specifying a local path argument is fine too. 'tf <command> <WorkspaceRoot> /recursive' is equivalent to leaving off the filespec.
Richard Berg
2009-07-24 13:05:12
Thanks Richard after a couple of tweaks to the rest of my script this is working perfectly for me now. It's going to save me a lot of time and hassles, great answer.
John C
2009-07-27 14:35:21