Home  >  Q&A  >  body text

After git merge, no conflicts will occur between merges and conflicts, but will be replaced directly.

1. The official environment has a warehouse, but for convenience, my colleagues at that time directly packaged it and developed it in the test environment. Now that the development is completed, this newly developed part has not been included in the version library. Don't know how to merge.

2. I now create a new branch based on the dev branch, and directly replace the files under the new branch with files that have not been included in the repository before, and add commit.

3. I now created a dev2 branch based on the dev branch, switched to dev2, merged the new branch, and found that the files did not merge or conflict during the merge process, but deleted the files under dev2. Created new files under the new branch.

Excuse me if you encounter similar problems, please give me some advice. Thanks!

伊谢尔伦伊谢尔伦2698 days ago1052

reply all(3)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-06-22 11:54:46

    Two questions.

    1. Which part do you mean by "newly developed part"?

    2. What do you need to turn dev2 into now?

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-06-22 11:54:46

    You can try the git cherry-pick command to merge a commit into a branch.

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-06-22 11:54:46

    git merge will actually perform a three-way merge of the last working node of your current dev2 branch, the last node of the new branch and their common parent node. Compared with their common node, the new branch is equivalent to changing all files, and The dev2 branch has not changed, so git will choose to automatically
    merge to replace the files on dev2

    According to what you said, your colleague should have only adjusted some functions. You can consider using git difftool to manually merge the two branches

    reply
    0
  • Cancelreply