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

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值