Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何确定哪些提交在git中被压缩?_Git_Git Rebase_Githooks - Fatal编程技术网

如何确定哪些提交在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的克隆中无法工作

除非用户在评论中系统地记录了挤压,否则该信息(提交已挤压)将不可用