Reputation: 835
when you are merging your changeset in Microsoft TFS Source Control, your changes may come into a conflict, then if it couldn't become auto-resolved, you have to resolve it by yourself. or you can take source version or keep target version. another workaround is to discard your changeset.
"keep target version" and "discarding changeset", both of them are saying that the target version is the correct one that will be kept. So, what's the difference between them exactly? why both of them exist?
Upvotes: 1
Views: 584
Reputation: 114471
The difference is in the subtle way the history is kept. When you "Keep target version" a change ticket is stored with the merge telling it to ignore the differences in the future.
When you "undo" the changes in the merge, no ticket is logged and a future merge between those branches/files will propose to merge those changes again.
You'd perform the second (undo) if you have changes that are not yet ready to merge to the target branch, but were (accidentally) selected as part of the merge action.
You'd perform the first (Take/Keep) if you want that version to become leading and do not want to merge those differences in the future.
Many developers do not understand the difference and issues can occur when you have long-living branches, like dev
& main
. If people use "keep target" a lot, a merge between dev and main would not show any changes to merge, but a diff between the two may bring a lot of differences to light. In general I guide teams towards undoing the changes vs picking "keep mine" or "take theirs".
Upvotes: 1