首页 > 解决方案 > git: see the parent commit of a squash merge

问题描述

lets say I have the following graph

master  A------D
         \
feature   B--C----E

If D is a squash-merge of feature at commit C, but then a new commit (E) is pushed to feature, there is no obvious link between commit D and the exact commit that was merged into master.

My question is whether it is possible to retrieve this link. Is there a git command that can be run that will, for a squash-merge, return the commit hash of the exact commit that was squashed in?

NOTE: The commit message was changed in my repo, so the fact that by default git will record the commit hashes that are squashed in the message is not useful

标签: git

解决方案


你告诉 Git 不要记录合并,然后抹去它提供的关于没有记录它的自我说明。就是这样,你已经找到了 Git 的所有合并记录,并告诉它销毁它们。


推荐阅读