命令行内解决git rebase conflict
来源:互联网 发布:egg drop. 算法 编辑:程序博客网 时间:2024/06/05 07:01
进行Rebase时,遇到conflict
当我们执行操作git rebase somebranch时,有可能遇到冲突,冲突的文件中会包含以下内容:
<<<<<<< HEADCreating a new branch is quick & simple.=======Creating a new branch is quick AND simple.>>>>>>> somebranch
握草,什么鬼,怎么又有冲突,要吓死宝宝吗?回退吗?直接用merge算了?
这个时候,不能屈服,一定不要屈服,不就是冲突么,只是个小boss。
解决冲突前的概念
在<<<<<<< HEAD和=======之间的是我们当前分支的内容,为ours
在======= 和>>>>>>> feature1之间的是somebranch上面对应的内容,为theirs
那么如何解决冲突呢?
确定内容该如何修改,
git diff
,有三种情况:- 使用我们当前的
- 使用somebranch分支上面的
- 两个都需要。
内容修改:
- 使用我们当前的内容,执行
git checkout --ours conflict-file-name
- 使用somebranch分支上面的内容,执行
git checkout --theirs conflict-file-name
- 如果都需要使用,则
vim confict-file-name
,直接编辑冲突文件,修改之后直接wq
退出编辑。
- 使用我们当前的内容,执行
执行
git add .
git rebase --continue
如果执行之后没有成功,有其他提示,按照提示git rebase --skip
执行进行即可。- 擦亮眼睛,我去,怎么还没有弄好!?
- 淡定,重复1至4步,直到返回正常分支。
- 大功告成,舒坦!!!呼......
阅读全文
0 0
- 命令行内解决git rebase conflict
- git rebase 出现conflict怎么办
- 【Git】git rebase+fix conflict+git add+git rebase --continue或git merge+fix conflict+git add+git commit
- git解决rebase冲突
- git rebase解决提交冲突
- Git 使用rebase解决冲突
- git 解决主库冲突conflict
- 【转】解决 Git 的 Merge Conflict
- git rebase 过程中解决冲突conflic
- Git rebase、pull、push 出现 conflict 后不能merge的解决方法
- Git Conflict
- git- rebase
- git rebase
- git rebase
- git rebase
- git rebase
- git rebase
- git rebase
- python字符串格式化笔记
- Python中实例的attributes、Properties以及Descriptors
- JavaBean
- jenkins+svn+maven自动发布平台项目案例
- Redis热数据存储问题
- 命令行内解决git rebase conflict
- 摆脱celery限制
- Hadoop+Spark 之旅—脚踏实地、仰望星空(教程目录)
- android activity之间自定义类的传递
- 记Nginx正向代理请求参数
- python中partial的使用规则
- 用SPFA求解最短路径问题
- 解决YouCompleteMe"encoding" is an invalid keyword 错误
- Codeforces 292D [Connected Components]--并查集的巧妙应用