问题
I'm issuing the following command to TFS:
>tf merge /baseless c:\ws\source c:\ws\target /recursive /version:C100~C100
But I have a large list of changesets that need to be merged. Is there a shortcut for this, or some way to specify a list, for example:
>tf merge /baseless c:\ws\source c:\ws\target /recursive /version:C100,C108,C110,C800,C1001,etc...
回答1:
If powershell is an option, below script should help (not tested!):
$cslist = 1,23,45,456,568 #list of all changesets
foreach ($cs in $cslist) { & 'C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe' merge /baseless c:\ws\source c:\ws\target /recursive /version:C$cs }
回答2:
Grabbed this from another post, you may have seen it but as I haven't ran into this I'm just trying to lend a hand.
You have a couple options:
- If you know the changesets you want to merge (or the changesets you want to avoid merging) you can choose a folder up the structure from the files you want to merge then do the merge by selecting the specific changesets you want. This is a little complicated if you have changesets 2000,2001,2004, 2010 and you want 2001 and 2010. You can only merge consecutive changesets in the list per merge so you would have to merge 2001 then 2010. This is still better than merging many files if you have more files then changeset groups.
- If you want to merge everything under that folder up to a specific changeset or most recent changeset you can do that in one bulk merge.
In both of these you will still have to resolve issues where a different change was made to the same line in the same file in the source and target branches.
OP: Merge multiple files in TFS
回答3:
The following extension claims to do this:
TFS Productivity Tools - Extended Merge 2012
ExtendedMerge extension provides workaround for several merge features not implemented by TFS:
- TFS merge leads to bulk check-in operation that puts files from all previous changesets into one big merge changeset.
- TFS allows only for consecutive changesets being cherry-peeked by merge operation.
- TFS doesn’t allow choosing changesets for cherry-peek merge by selecting work items.
- TFS merge dialog doesn’t have “force” and “baseless” options.
You'd might also want to upvote this feature in the Visual Studio User Voice.
来源:https://stackoverflow.com/questions/11246679/baseless-merge-for-multiple-non-consecutive-changesets