0

Let's suppose that I have three branches:

Main
+--Dev
+--Release

And several changesets in Dev: changeset 1, 2 and 3 and all three changesets affect some File. At some point I merge them all into Main and get changeset 4, that includes changes from all three changesets.

What should I do if at this point I have to merge changeset 2 also into Release branch? If I try to merge from Main into Release I'll have to merge changeset 4 and then manually include only necessary edits made on File. But in this case after checkin, TFS will mark whole changeset 4 as merged and will not offer it later for merge, despite the fact that changes from changeset 1 and 3 were not included.

I know I could have avoided this situation by merging each changeset from Dev into Main separately, but that's very tedious and doesn't seem like a right way.

I could also use baseless merge and go directly from Dev into Release, but that's something I consider to be an extreme measure.

Are there any other ways?

Adam Dymitruk
  • 124,556
  • 26
  • 146
  • 141
Vitaliy Kurokhtin
  • 7,205
  • 1
  • 19
  • 18

1 Answers1

0

Sounds like you need feature branches. You could then just merge change set 2 into release. You can still do this after rebasing or cherry-picking change set 2 off of the common ancestor into a feature branch.

Git-tfs will help you do this.

Hope this helps

Adam Dymitruk
  • 124,556
  • 26
  • 146
  • 141
  • Yes feature branches is a one way to do it, but it still does require to think ahead. What do you mean by rebasing? I'm in a situation where only a few changes should go into Release, so I can't just merge everything into it. – Vitaliy Kurokhtin Jun 08 '11 at 17:19
  • You can extract what you did and apply that change set as of it happened off of the common ancestor. That's what git-tfs enables you to do. – Adam Dymitruk Jun 08 '11 at 17:21
  • Hm... Are you suggesting to repeat changes in changeset 2 directly in Main, checkin them, and then merge this new changeset into Dev and Release? – Vitaliy Kurokhtin Jun 08 '11 at 17:29
  • not into main. you start the new feature on the common ancestor. Cherry-pick into that branch, then merge into release when ready. – Adam Dymitruk Jun 08 '11 at 17:48
  • @Vitaliy, Adam: git-tfs doesn't have support for TFS branches yet. Work in progress currently. – Ivan Danilov Aug 10 '11 at 07:52
  • You can keep that on the git side and just work with TFS in the usual trunk fashion. – Adam Dymitruk Aug 11 '11 at 21:11