糖尿病康复,内容丰富有趣,生活中的好帮手!
糖尿病康复 > git代码合并了后发现有冲突 我们怎么取消合并?

git代码合并了后发现有冲突 我们怎么取消合并?

时间:2018-12-16 19:23:41

相关推荐

git代码合并了后发现有冲突 我们怎么取消合并?

项目场景:

git代码合并了后发现有冲突,我们有时候不想解决冲突,不想合并了;或者别人把冲突解决完了,自己想拉取一下最新代码,咋办呢?

解决方案:

使用命令行

git merge --abort

测试实现:

D:\cloud\ui-console (release/V3.4.1.1-1122 -> origin)λ git pullremote: Enumerating objects: 7, done.remote: Counting objects: 100% (7/7), done.remote: Compressing objects: 100% (7/7), done.remote: Total 7 (delta 0), reused 0 (delta 0), pack-reused 0Unpacking objects: 100% (7/7), done.From http://gitlab./cloud/pco/ui-console31bb89ec..b010f16d release/V3.4.4-1130 -> origin/release/V3.4.4-1130Already up to date.D:\cloud\ui-console (release/V3.4.1.1-1122 -> origin)λ git checkout release/V3.4.4-1130Switched to a new branch 'release/V3.4.4-1130'M src/components/iam/logger/index.vueBranch 'release/V3.4.4-1130' set up to track remote branch 'release/V3.4.4-1130' from 'origin'.D:\cloud\ui-console (release/V3.4.4-1130 -> origin)λ git pullAlready up to date.【将release/V3.4.1.1-1122分支代码合到release/V3.4.4-1130分支】【合并过程有了冲突了】D:\cloud\ui-console (release/V3.4.4-1130 -> origin)λ git merge release/V3.4.1.1-1122 release/V3.4.4-1130Auto-merging src/components/workorder/orderDetail/components/order-detail-tab.vueCONFLICT (content): Merge conflict in src/components/workorder/orderDetail/components/order-detail-tab.vueAutomatic merge failed; fix conflicts and then commit the result.【别人提交的代码,自己不想解决冲突,让别人解决完冲突后自己拉取一下代码,发现有没有合并代码的错误】D:\cloud\ui-console (release/V3.4.4-1130 -> origin)λ git pullerror: You have not concluded your merge (MERGE_HEAD exists).hint: Please, commit your changes before merging.fatal: Exiting because of unfinished merge.D:\cloud\ui-console (release/V3.4.4-1130 -> origin)λ【使用git merge --abort 取消合并】D:\cloud\ui-console (release/V3.4.4-1130 -> origin)λ git merge --abort【再进行git pull】D:\cloud\ui-console (release/V3.4.4-1130 -> origin)λ git pullUpdating b010f16d..0ceb5fadFast-forwardsrc/components/expense/pay/openService.vue | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)D:\cloud\ui-console (release/V3.4.4-1130 -> origin)λ git pullAlready up to date.

如果觉得《git代码合并了后发现有冲突 我们怎么取消合并?》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。