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!
Two questions.
Which part do you mean by "newly developed part"?
What do you need to turn
dev2
into now?You can try the git cherry-pick command to merge a commit into a branch.
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 automaticallymerge 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