美文网首页Git
git rebase 冲突简单记录

git rebase 冲突简单记录

作者: 梧叶已秋声 | 来源:发表于2020-04-01 18:00 被阅读0次

commit之后使用git rebase失败,原因是发生冲突。
比如某a.java文件中的b()函数,我修改了b()函数中的部分内容,但是其他人先我一步把b()函数给屏蔽了。因此当我rebase的时候会发生冲突,导致失败。

此时执行
git branch -a
显示。

* (no branch, rebasing xxx)

解决办法是首先执行

git rebase --abort

放弃执行此次rebase。

然后放弃此次commit。
git reset --soft HEAD^

但是此时,依然是add后的状态。
因此,需使用
git reset HEAD ,取消add。
最后使用 git checkout a.java,取消a.java的修改。

最后,由于别人已经把问题修改完成,因此最后不再需要修改并提交了。
参考链接:
git rebase
Git分支合并冲突解决

相关文章

  • git rebase 冲突简单记录

    commit之后使用git rebase失败,原因是发生冲突。比如某a.java文件中的b()函数,我修改了b()...

  • git rebase解决合并冲突

    记录合并冲突解决方法,使用的git rebase,感觉很好用 1.git rebase 文档 https://gi...

  • 如何正确rebase

    git rebase -i origin/分支 合并冲突 git status git rebase --cont...

  • Git使用教程

    拉取代码的正确步骤 git fetch git rebase git rebase --continue(遇到冲突...

  • 工作中使用 Git 解决问题的场景

    简单来说,就这七点: 使用 git rebase 让提交记录更加清晰可读 使用 git reflog + git ...

  • git pull冲突

    j解决了冲突之后,git add, 然后git rebase即可 如果有unstash的文件,在rebase之前先...

  • Git 篇

    1、合并分支 git rebase XX , 然后解决冲突 ,再 git add -A , 再git rebas...

  • 工作中常用的11个git命令

    1、git解决冲突完毕,不用再commit了,直接 git add . git rebase --continue...

  • 修复rebase删掉的代码

    问题 rebase时如果出现冲突,使用$git rebase --skip会删掉本地的commit 如何恢复 在当...

  • 如何理解git rebase?

    在merge PR的过程中,rebase and merge会产生冲突,因此需要补充一下Git rebase的知识...

网友评论

    本文标题:git rebase 冲突简单记录

    本文链接:https://www.haomeiwen.com/subject/ngbauhtx.html