Merge two TFS branches with git tfs

Ceilingfish picture Ceilingfish · Dec 19, 2011 · Viewed 8.2k times · Source

I'm using git-tfs, and I was wondering if it is possible to merge two TFS branches using git-tfs. I have two branches $/MyCompany/Dev & $/MyCompany/Release-3.3. Release-3.3 originates from the Dev branch. Both are checked out as different git repositories using git tfs.

I'd like to re-incorporate the changes back into the Dev branch. Can this be achieved with git-tfs or will I have to resort to trying to do it using TFS tools?

Answer

Philippe picture Philippe · Dec 6, 2012

Since git-tfs 0.16, you can manage TFS branches (with branch command) so you can now easily init existing branch, create one and merge TFS branches!

https://github.com/git-tfs/git-tfs/blob/master/doc/commands/branch.md#initialize-an-existing-tfs-branch

And since the release 0.19, you can do a git merge of 2 TFS branches and checkin it in TFS (with rcheckin) and it will be checked in as a merge changeset : https://github.com/git-tfs/git-tfs/blob/master/doc/commands/rcheckin.md#checkin-a-merge-changeset

The only limitation (due to TFS) is that all the commits should have been already checked in TFS before doing your merge with git and check it in TFS.

So you can now merge more easily than with 2TFS branches and check them in...