最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

git - How to get the list of dependant commit to cherry-pick a commit without conflicts? - Stack Overflow

programmeradmin2浏览0评论

I have two branches, for example master and old-release. In master I have a commit C that I want to backport, but I also introduced required changes (like a refactoring) in a previous commit R that are needed to cherry-pick C into old-release without merge-conflict. How can I get the list of commits that are needed to cherry-pick C from master to old-release (recursively if R itself has dependent commits not in the target branch)?

* C (master)
* unrelated-3
* unrelated-2
* R
* unrelated-1
|  * other fix (old-release)
| /
* unrelated-0
* ...

Said otherwise, give a commit C and a target branch old-release, I want the list of commits that, if cherry picked in order would allow to cherry-pick C into old-release without any merge conflict.


If we name the common ancestor A, I assume that such command or external tool would use the same mechanism than git blame look at all the line modified by C, and if the original line was not present in A, then add that commit to the list of commit to cherry-pick, then repeat for all those other commits.

发布评论

评论列表(0)

  1. 暂无评论