解决在一个topic branch上有多个cherry pick commit修改后repo upload 失败问题

来源:互联网 发布:网络终结者4.22破解版 编辑:程序博客网 时间:2024/05/20 03:45

cherry pick patch之后,又提交新的patch,会出现如下的错误: “remote reject…..no changes made”


     解决办法:
     假设先拿的A patch, 然后新的修改是B patch.
     1. 通过 git log, 取得A patch的commit id id-A, 及其前一个patch的commit id id-old。
     2. git rebase -i id-old
     3. 这时候会弹出页面,将第一行第一个命令 pick改为edit,退出。(如果提示有没提交的change,git stash 一下即可)
     4. 执行 git commit --amend,这时候弹出的commit message应该是A的,随便改改,提交。
     5. 执行 git rebase --continue,提示完成rebase。
     6. repo upload.
     后面是参考的原文,关于commit id貌似有点问题。反正git commit --amend的时候,弹出的commit界面应该是patch A 的就对了。

后面是原文:

 solve repo upload failed problem due to no changes made

最近在工作中碰到了这个问题, 在探讨一番后解决了,由于工作书面语言是英语,所以就用英语写了。

In a topic branch, when you have cherry-pick several commits, such as two commits (A and B, B is depend onA), then you made changes on latest commit B, at the end you try to repo upload, it might failed with message “remote reject…..no changes made”.

 

How to solve it?

From the “git log”, get thecommit A’s commit id,  

for example 489d62d7a0feb3e95d1e7dcdc446be1be51175f6,then do

 

git rebase -i 489d62d7a0feb3e95d1e7dcdc446be1be51175f6

  // Then it would pop up a dialog, change the onerelated to commit A from "pick" to "edit"

// then change commit A’scomment,

 git commit --amend

 git rebase --continue

 repo upload .

这样就可以顺利上传了。


阅读全文
0 0
原创粉丝点击