gittfsgit-mergetfvcgit-tfs

Merge branches in GIT after migration from TFS


We had TFS repository with one branch "Main". Then we branched it to another, "Main-MERGE". Both has been long term branches, but in some points we made some merges. All works fine.

Now we migrated whole repository to GIT using git-tfs. All seems to be ok, we are working on both branches in GIT.

Well, now we decided to merge "Main-MERGE" -> "Main" to have only one "master" branch. But it seems to be impossible. Using merge there is no conflict and result is not as expected. Seems it is more rewrite then merge.

Does it mean, that there is no way to merge files as in TFS when branches are migrated to TFS? All seems fine in history. Migrated commits seems to be connected with parents. How can I find problem and merge branches?


Solution

  • Update:

    You should be able to merge commits which made after migrated normally. It's just like you are working on a new git repo. For other older commits migrated from TFS, you will be able to see them history info. But you could not able to merge single commit, they bind together as a new one commit in your Azure DevOps repo.

    Op finally get changes back to TFS, then merged and migrated back to GIT. Took some time, but ok.


    There are some differences for merge in TFVC and Git:

    When planning your migration you should choose a new branching strategy for Git.

    Have no idea why you could not preform merge in Git after your migration. Suggest you double check your entire process, if there is some missing or wrong. You could kindly refer this blog with step by step portal: Migrating from TFVC to Git (for large repositories)

    But in your situation, since you are going to combine that two branches and have only one "master" branch in your Git Repo.

    A better way is do the merge before your migration from TFVC to Git. You could have the only "master" branch in TFVC first. After then you could create a branch based on migrated master branch in Git Repo.

    Besides, since through this way only a single branch is migrated. Migrating only the main branch supports a topic-branch based workflow. You could also consider to use TFVC Import tool.

    More details about migrate from TFVC to Git please kindly take a look at our official tutorial here.