当前位置: 首页 > 工具软件 > git playback > 使用案例 >

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

洪承天
2023-12-01
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


 类似资料: