问题
How do I tell TFS that pending file delete and add is actually a rename ?
For example, I deleted
201505132029594_InitialCreate.cs and tool created
201509141933543_InitialCreate.cs
I'd like to tell TFS that this was a file rename+edit. Ideally, from command line, something like
tf rename /someswitch 201505132029594_InitialCreate.cs 201509141933543_InitialCreate.cs
Apparently, this functionality exists in the UI (see "To fix the results of an operating system rename"):
https://msdn.microsoft.com/en-us/library/ms181398(v=vs.110).aspx#fix_os_rename
Unfortunately I can't find it (nor can other people apparently)
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/3c909ee5-f6fa-4415-b31c-4822fc30405c/fix-the-outcome-after-you-rename-an-item-in-your-operating-system?forum=tfsversioncontrol
回答1:
You can rename using the TFS API. In your case, you only need to let TFS know what happened and do not need to change anything on disk. Thus, use the Workspace.PendRename method and specify false
for updatedisk
.
来源:https://stackoverflow.com/questions/32592050/tfs-pending-deleteadd-file-rename