I would ask you if you have some experiences with merge by tf.exe. I have two branches - branch 1 and child branch branch 2 created from branch 1. I have some changesets in branch 2 and I want to merge it to branch 1 (reverse integration). I merge it by tf.exe (my external tool call it). Then I want to show merge candidate from branch 1 to branch 2 (forward integration) and there are changesets created by previous merge from branch 2 to branch 1.
I compare branch 2 and branch 1 after merge from branch 2 to branch 1 and there are no differences. But I have still changesets in branch 1 which want to merge brachn 2. When I would merge these changesets from branch 1 to branch 2 (forward) then there are conflicts in resx files.
When I merge these changesets from branch 2 to branch 1 by Visual Studio there are not changesets to merge from branch 1 to branch 2.
What is different? I use my external merge tool because of create some reports of merged changesets and some reason of planning and releasing.
I found some related topics but there was about renaming of branches. But I have stable naming branches. Problem is when I do forward integration because this changesets do problems in merge.
Related
I have list of changesets in 1 branch of TFS that i need to merge to another branch in TFS.
Is there any way to get the list of conflicting changesets(even if TFS can resolve the conflict) based on the changesets that modified the same file but is not selected to be released?
Example:
1 file is modified twice in changeset 1 and 2
i want to release changeset 2.
Is there anything you can do on TFS to automatically tell me that changeset 1 changes are conflicting with this merge?
I have an issue; we have a Main branch, and we have few changesets (that belong to 3 different features).
I created three DEV branches By Date (and selected a date that is prior any of the changesets).
I cherry picked the changesets from Main, and merged them to appropriate DEV branches.
I RolledBack all these changesets from Main so that, the main becomes clean.
Now I want to merge one of DEV branch to Main and deploy for testing,
The problem is; it doesn't pick all the changesets, and even for the ones that it picks, it doesn't pick all the modified files.
How can I merge from DEV to Main? Please help.
Thanks
When TFS does a merge, it bases the merge on prior merge history, not on the actual contents of the source and target files.
You could try the /force option with the tf merge command. The /force flag ignores merge history that indicates a particular changeset was previously merged from source to target (perhaps incorrectly), and merges the changeset again. You can do a /force merge for a single changeset or for a range of changesets. For just changeset #123456 the command would be:
tf merge /force $/Source/File.cs;C123456~123456 $/Target/file.cs
Check the following blog for more details:
https://blogs.msdn.microsoft.com/billheys/2011/03/16/my-source-and-target-files-are-different-but-merge-tells-me-there-are-no-changes-to-merge/
I'm using TFS 2010. I have 2 changesets in child branch that I do not want to merge in the parent branch.
e.g
(1002) Rolled back changeset
(1001) Changeset checked in by mistake
I don't want these changesets from appearing in the merge menu when you attempt to merge into the parent branch.
If I have understood correctly that I can use the following TFS command to ignore these 2 particular changesets or will the rollback changeset interfere?
tf merge childbranch parentbranch /r /version:1001~1002 /discard
You can do a discard
merge.
This has to be done from the command line. Open up the Developer
command
prompt,
then navigate to a folder under either of your branches (i.e. navigate
to one of the affected
workspaces).
Then type:
tf merge /r /discard "$/Project/B1" "$/Project/B2" /v:C12345~C12345
This will take the changeset identified (in this case it was changeset
#12345), and update it as merged to the target branch (branch B2). The target files will be checked out, but they will not be changed - you
can simply check them in to complete the operation. After that the
changeset will no longer appear as a merge candidate. You can specify
a range of changesets to merge at the same time, but they should be
contiguous.
Note that after doing this a changeset will occasionally still show up
as a merge candidate - this is rather uncommon with the latest
versions of TFS, and it is virtually impossible to fix (unless you are
running your own local install of TFS and want to get your hands very
dirty in the database). If you end up with one of these marooned
changesets, just ignore it.
Source:
Finding merge candidates in TFS
Note: When the command has finished, you still need to check in the merge.
For more tutorials, you could also refer below blogs:
TFS: Discard changesets when merging to branches
DISCARDING CHANGESETS IN TFS
Let’s say branch A is a created from trunk. The branch A is in testing stage. Now there is a new project and will be release after branch A. However the project must start and cannot wait the branch A to be released. There is a big change in branch A and branch B is a few changes. I want to create a branch B from branch A. When branch A is release, it merge to the trunk. After branch B is completed and released, the branch B merge to the branch A and then Branch A merge back to trunk. Is it possible in TFS to merge trunk as the above approach?
TFVC branches are hierarchal. You can do a baseless merge, but that typically indicates a failure in your branching strategy.
The "modern" approach is to minimize the number of branches you create (or eliminate branches entirely) and instead rely on feature toggles to isolate work-in-progress, so that your codebase is always integrated.
I have some changesets in a TFS 2008 branch which were not merged back into trunk. Time has passed, and now no-one is entirely sure which changesets have made it into trunk. I understand that TFS 2010 allows you to see graphically which branches a changeset has been merged to, but how can I find this out in TFS 2008?
I think all you can you do is use the TF merge command to determine which changesets have not been merged into another branch - one branch at a time.
tf merge /recursive /format:brief /candidate $/Branch1 $/Branch2 /preview
will show you what changessets from branch1 are candidates to be merged into branch 2. Of course you can put this into a script to run multiple times.