git rebase時候出現衝突問題

上面一篇文章寫了git rebase 如何操做https://blog.csdn.net/weixin_43978695/article/details/104955182,可是,有時候咱們代碼可能會出現衝突,怎麼解決呢?
出現的問題:
git rebase -i master
Auto-merging APP-META/docker-config/Dockerfile_testing
CONFLICT (content): Merge conflict in APP-META/docker-config/Dockerfile_testing
Auto-merging APP-META/docker-config/Dockerfile_staging
CONFLICT (content): Merge conflict in APP-META/docker-config/Dockerfile_staging
Auto-merging APP-META/docker-config/Dockerfile_production
CONFLICT (content): Merge conflict in APP-META/docker-config/Dockerfile_production
error: could not apply 1479a8f5… update base image
Resolve all conflicts manually, mark them as resolved with
「git add/rm <conflicted_files>」, then run 「git rebase --continue」.
You can instead skip this commit: run 「git rebase --skip」.
To abort and get back to the state before 「git rebase」, run 「git rebase --abort」.
Could not apply 1479a8f5… update base image
解決方案:
1.先 git rebase --abort
2.先 git status 查看一下狀態,對有有衝突的文件,先修改一下,修改完以後,
(APP-META/docker-config/Dockerfile_production 這個是須要修改的文件)
2.$ git diff APP-META/docker-config/Dockerfile_production
3.git add APP-META/docker-config/Dockerfile_testing
4. git rebase --continue
5. esc :wq
6. 若是還有問題,繼續上面查看status,修改文件,git diff 文件,git add 文件, git rebase --continue esc :wq,直到沒有衝突爲止
7.git push -f origin 個人當前分支前端

完美解決!git

補充:若是是前端代碼,可能在rebase以後會出現以下問題:
在這裏插入圖片描述
解決方案:從新checkout一下,還原文件,繼續 rebase 就能夠了。web