如何确定哪些提交在git中被压缩?
我正在编写一个脚本,它将一些提交的引用保存在存储库中,但如果一些提交被压扁,那么引用将无效。我知道有如何确定哪些提交在git中被压缩?,git,git-rebase,githooks,Git,Git Rebase,Githooks,我正在编写一个脚本,它将一些提交的引用保存在存储库中,但如果一些提交被压扁,那么引用将无效。我知道有pre-rebasehook,但没有post-rebasehook,所以有没有办法确定哪些提交被挤压在一起 例如,在rebase之前,我有以下历史记录: cf79121 Refactor the trim_file_name method. Closes #1965. 82ed26a Updated dependencies and project versions. 8047297 Update
pre-rebase
hook,但没有post-rebase
hook,所以有没有办法确定哪些提交被挤压在一起
例如,在rebase之前,我有以下历史记录:
cf79121 Refactor the trim_file_name method. Closes #1965.
82ed26a Updated dependencies and project versions.
8047297 Updated Node.js implementation package information.
b2b727c Added "finished" callback, which is called for each "completed" or "failed" event.
在rebase之后,我得到:
cf79121 Refactor the trim_file_name method. Closes #1965.
9b7ac26 Updated dependencies, project versions, and node.js package information.
b2b727c Added "finished" callback, which is called for each "completed" or "failed" event.
我如何才能找到
82ed26a
+8047297
=9b7ac26
?除非该信息仍在您刚刚提交git squash的repo的reflog中,。。。我认为你无法找回这些信息。见“” 因此,您的脚本可以在发生挤压的本地git repo中工作,但在同一个repo的克隆中无法工作 除非用户在评论中系统地记录了挤压,否则该信息(提交已挤压)将不可用