git提交代码,拉取时报错

error: Your local changes to the following files would be overwritten by merge:
Please commit your changes or stash them before you merge.
Aborting
error: Failed to merge in the changes.
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Patch failed at 0001 提交邮寄

The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

错误:您对以下文件的本地更改将被合并覆盖:
请提交更改或在合并之前将其保存。
中止
错误:在更改中合并失败。
使用索引信息重构基础树…
回落到修补基地和三路合并…
补丁0001失败

在.git/rebase-apply/patch中可以找到失败补丁的副本

当你解决了这个问题时  运行:git rebase --continue
如果您希望跳过这个补丁  运行:git rebase --skip
恢复原始分支并停止rebasing  运行:git rebase --abort

其实,window电脑用提交代码的时候用 git pull -r 拉取代码,很容易出现这种错误。而且还不是代码冲突。

通常,我遇到这种错误,看到自己的文件被删后。我会直接,运行以下代码。

git status   //看一下状态
git rebase --abort
git status
git pull -r
git push

如果是代码冲突,那就好办了。解决完冲突后,直接运行以下代码就行

git add .
git status
git rebase --continue
git status
git pull -r
git push

猜你喜欢

转载自blog.csdn.net/xiasohuai/article/details/81358506
今日推荐