git中 Please merge (or rebase) the change locally and upload the resolution for review.

Gerrit Code Review 10:22 AM

Your change could not be merged due to a path conflict.

Please merge (or rebase) the change locally and upload the resolution for review.


无法合并代码的处理方法

1.先在gerrit页面"abandon change"

2. 回到本地代码目录,运行 git reset HEAD^      

   这个命令的仅仅把HEAD指向提交前的一个<commit> “^”代表重置一次提交,如果你要费掉多次提交,多加几个“^”就是

3.git stash 

   备份当前的工作区的内容,从最近的一次提交中读取相关内容,让工作区保证和上次提交的内容一致。同时,将当前的工作区内容保存到Git栈中。

4.git pull

  获取服务器最新代码

5.git stash apply

 从Git栈中读取最近一次保存的内容,恢复工作区的相关内容。由于可能存在多个Stash的内容,所以用栈来管理,pop会从最近的一个stash中读取内容并恢复。


6.最好重新提交 

git add <files>

git commit -m "msg"

git push


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值