Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
531 views
in Technique[技术] by (71.8m points)

command line - In TFS, how do I do a baseless merge on specific changesets?

As with most things in TFS you get more than you bargained for. In this case I am seeing more file changes during the merge than I was expecting.

I have 2 child branches, lets be exciting and call them branch1 and branch2. Both have changes made to them since they were created. I need to take 12 specific changesets from branch2 and merge them into branch1. The changes from branch2 can not go back to the parent branch. So it's a straightforward case for a baseless merge, but the results are not what I expected.

Taking the first changeset I ran the following command:

tf merge /baseless /recursive /version:C95654 branch2 branch1

Changeset 95654 contains 12 changed files but after this command I get 56 edited files with conflicts. I was expecting to only merge the specified changeset from one branch to the other but it appears to have merged the entire folder.

So why do I get 56 files changed rather than 12 when I specified the changeset? Also what can I do to restrict what is merged to only the contents of that changeset?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If you need to merge a specific changeset you need to use the following statement:

tf merge /baseless /recursive /version:C95654~C95654 branch2 branch1

(It means ONLY changeset C95654).

The commandline you are using means every changeset before and with C95654.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...