StoneJedi
StoneJedi

Reputation: 575

TFS Merge by File Version

I posted a question a while back concerning the downsides to Merging individual files.

Is it okay to merge individual files from one branch to another

The answer posted said that I should do by changeset rather than by file version. However, I've been reading that merging by changeset (cherry picking) is a very bad idea. You might end up getting merges you don't intend unless you really understand the contents of each changeset and how TFS stores deltas.

I'm trying to convince my team in our migration from VSS to TFS that we should only be merging at the branch level. However, I lack a good example of the potential impacts of merging by file version. Can anyone explain or provide a good link to information on merging by file version (not necessarily changeset).

Something I'm not sure on is if you merge by file version, are you still merging the changesets associated with that file version? If those changesets affect other files, do those files get changed?

Thanks in advance guys!

Upvotes: 1

Views: 1077

Answers (1)

James Reed
James Reed

Reputation: 14052

TFS doesn't have a concept of file versions. If you want to merge a specific version of a specific file you have to use a combination of filename and changeset something like

tf merge $/TP/Branch1/file1.cs $/TP/Branch2/file1.cs /version:C1234

you can do the same using the GUI by selecting the file, Right click, and merge. In the merge wizard choose "selected changesets" from the dropdown instead of "latest version" (you can do the same thing at the folder level.)

If you merge this way the TFS remembers that the changeset has been partially merged and will prompt you to merge the rest of the changeset next time you merge.

you can see partial merges by using

tf merge $/TP/Branch1 $/TP/Branch2 /recursive /candidate any changesets in the list with a * next to them have been partially merged already

Upvotes: 3

Related Questions