Moving and renaming are aliases. In any version of TFS, there is no difference from the command line or user interface.
Both keep a story. At least in 2005/2008, you keep the same physical element in the VersionedItem table no matter how often or how much the name and / or parent path changes. There is really no way to get a โfakeโ rename (delete + add) without a lot of manual work on your part.
However, although this version model is very pure in a theoretical sense, it has some practical errors. Since different elements can occupy the same name at different points in time, TFS requires a full name + version to uniquely identify any inputs that you send. Usually you did not notice this restriction, but as soon as you rename elements in the system, if you say tf [doSomething] $ / newname -version: oldversion , then it will be confused and either throw an error or work with an item that you may not planned. You must be careful to pass valid combinations (newname + newversion or oldname + oldversion) to ensure that the commands behave the way you want.
TFS 2010 changes the story a bit: this is the + delete branch under the covers, as a result of which the ID element will change. However, daily commands, such as Get and History, are "faked" very well; old customers are approximately 95% compatible. The advantage is that when you have several renames in the system, and the search based on the path starts to become ambiguous, as indicated above, the server will simply accept the name that you specify and run with it. This improves overall system performance and eliminates several pitfalls often encountered by unfamiliar users, at the cost of not being so flexible and not preserving history with 100% accuracy (for example, when names collide when merging two branches).
Returning to the problem ...
It is not as simple as telling tf to rename $ / projectA $ / projectB . Top-level folders in the version control tree are reserved for the Team Project creation wizard; you cannot run standard tf commands against them. You need a script like:
Get-TfsChildItem $/ProjectA | select -Skip 1 |
[of course, you can do it manually if there arenโt many children in $ / ProjectA]
As I already mentioned, Iโll talk about this right now, as looking for an old story seems very important to you. When you check the rename, tf history $ / ProjectA / somefile.cs will NOT work. By default, tf commands assume version = "latest". Any of these alternatives will have the full story you want:
- tf history $ / ProjectA / somefile.cs; 1234 where changeet 1234 was before moving
- tf history $ / ProjectB / somefile.cs; 5678 , where changeet 5678 was after the move. Or you can just omit the version.
The ultimate alternative for completeness and debugging:
- tf history $ / ProjectA / somefile.cs -slotmode . You will only see changes that occurred before the move; however, you will also see a history of any other elements that might have lived in the slot $ / ProjectA / somefile.cs "before or after the element that you moved under B.
(In TFS 2010, slot mode is the default behavior, there is the -ItemMode option to request tracking of your search in history, as it was in 2008, and not based on paths.)
EDIT - No, forking is not a great alternative. While the fork leaves enough metadata in the system to keep track of the complete history in ProjectB and from ProjectB, this is not very convenient for users in 2008. Plan to spend a lot of time learning the tf merges command (there is no equivalent user interface). 2010 greatly improves your ability to visualize changes across multiple branches, but this is not a clean, unified experience that you will get from renaming.