2

Using tfs2015 (not git but tfvc)

We have a MAIN branch and I created my development branch from MAIN branch.

__MAIN (branch)
  |__MYDEV (my new branch)

After a while, my friends pushed 2 new changesets to MAIN.

__MAIN [change1], [change2]
  |__MYDEV [mychange1]

Question: How can I get those 2 changesets onto MYDEV branch as 2 changesets as they are by merging (rebasing) my change on their changes?

If I try merging MAIN onto MYDEV, 2 changesets are coming as pending changes of bunch of files, but I want them as they are as packaged in 2 changesets and put my changes on them.

Finally what I expect,

__MAIN [change1], [change2]
  |__MYDEV [change1], [change2], [mychange1-with-merge-fixes]
Community
  • 1
  • 1
mehmet mecek
  • 2,615
  • 2
  • 21
  • 25

2 Answers2

1

If you use git-tfs it will give you all the powers of git, highly recommended. Now, visual studio will maybe be a little bit upset when it detects a .git directory, but you can avoid that by setting GIT_DIR and GIT_WORK_TREE environmental variables (see this answer for details).

Community
  • 1
  • 1
hlovdal
  • 26,565
  • 10
  • 94
  • 165
-3

You can use "Rebase" tool to keep every merged changeset separately in the branch.

To use rebase tool in TFS, follow the steps below if you have Team Explorer installed:

  1. Launch Team Explorer and connect to your project.
  2. Open "Branches".
  3. Checkout the branch (MYDEV) you'd like to rebase.
  4. Right click the branch and select "Rebase Onto..." option.
  5. Select the Onto Branch (MAIN) and then click "Rebase" button. (Resolve the conflict and click "Continue" button if there is any conflict during the rebasing)

Introduction about TFS Rebase: https://msdn.microsoft.com/en-us/Library/vs/alm/Code/git/rebase

Eddie Chen - MSFT
  • 29,708
  • 2
  • 46
  • 60