==从分支dev合并到master==
git checkout dev
git pull
git checkout master
git merge dev
git push -u origin master
==从master合并到分支dev==
git checkout master
git pull
git checkout dev
git merge master
git push -u origin dev
==遇到的问题==
2021/5/14
执行git merge时报错
CONFLICT (modify/delete): rexel-core/src/test/java/com/rexel/test/CodeCounter.java deleted in HEAD and modified in master. Version master of rexel-core/src/test/java/com/rexel/test/Cod eCounter.java left in tree. CONFLICT (modify/delete): rexel-core/src/main/resources/mybatis/business/WaterElectricCostMapper.xml deleted in HEAD and modified in master. Version master of rexel-core/src/main/resou rces/mybatis/business/WaterElectricCostMapper.xml left in tree.
如果代码冲突的时候,需要强制使某一方生效,可以在下面的页面执行。
通过git status查看merge结果,可以看到有文件冲突。我的分支上把没有用的东西删除掉了,与master冲突。
解决办法
git add .
git commit -m '解决冲突'
git pull origin master
git merge master