TFS | unable to organize source project's files into multiple new folders

Viewed 121

I'm trying to organize TFS project to apply new structure

I moved the files from parent folder A to subfolders B C D but the msg appear

was not renamed in the source control database because there is already an item with this name in the destination folder

and any one get the latest version will face duplicated files error

Error Msg when moving files

What you suggested solution to this issue BTW I have too many files and folders

1 Answers

In TFS there are two kinds of moving files. I have crated a sample for both :

Local Workspace (window exploer) directly move/drag file


  1. In the disk my workspace, I'm going to move 2.PNG to Main-branch

    folder
    

enter image description here

  1. Then we could check what TFS detects in VS. One with add(in new

    place), one with delete(in old place) in Promote Candidate Changes.

    enter image description here

  2. You need to check in both the add and delete ( promote first). Finally

    you will get what you want both server and local.

Move a file in solution explorer directly


  1. In the solution explorer , I'm going to move 1.PNG to *Main

    folder* by right click and select move.

enter image description here

  1. You will get a pending change with rename status directly and

    not any Promote Candidate Changes.

    enter image description here

  2. Then we could check our local workspace, you will see 1.PNG is

    automatically deleted in the workspace folder even though you haven't check in changes. Finally checking pending

    changes, everything is fine and clean.

    enter image description here


Back to your error: xx was not renamed in the source control database because there is already an item with this name in the destination folder

You should be using way 2, so there was already some files with same name in parent folder A and subfolders B C D

The solution should be deleting duplicate files in B C D.


It's better to not move files frequently in TFS server folder, this will also mess up the history info.

Related