关于git:git-commit-之后-pull冲突后的解决方案

6次阅读

共计 927 个字符,预计需要花费 3 分钟才能阅读完成。

git 提交代码时,遇到抵触时,会呈现分支那里正在变基问题

因为在一个分支上协同开发,我在开发前 pull 了一下分支,那时候曾经有一部分的代码了,因为我和另一个小伙伴的代码有一部分是反复的,然而他的有问题,所以我须要批改,就改了他的一部分代码,而后我须要提交了。

git add .
git commit -m 'xxxxxxxx'

这时候须要对原有的分支进行 pull 一下,

git pull

pull 之后的提示信息,因为他有提交,并且我在他之后提交的地位做过批改,而后 pull 的时候会和已有的提交进行笼罩导致抵触
须要手动合并文件解决,
解决抵触后应用 git add 示意抵触曾经解决,
git rebase –continue 示意持续下一个抵触,
git rebase –skip 示意跳过以后抵触,
git rebase –abort 示意退出 rebase 模式,
回到运行 git rebase master 命令之前的状态。

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”.

解决完抵触之后,我保留上传始终重复,发现有变基。。
我应用了 git rebase –abort,想把变基去掉。然而应用之后。能够看他给出的提示信息。

“git add/rm <conflicted_files>”, then run“git rebase --continue”.

最初查找材料应用

git add .
(只有有批改都须要 git add . 或者 git add 具体的文件)
git rebase --continue(git rebase --continue 就相当于 git commit)依照提醒输出 qa:enter,具体看提醒
git push 就能够提交代码了

————————————————
原文链接:https://blog.csdn.net/weixin_…

正文完
 0