如何使用给定的提交消息进行git压缩提交

如何使用给定的提交消息进行git压缩提交,git,Git,我有几个“保存点”提交,希望将它们压缩成更具可读性的时间线。以下是我的情况: > git log 29a94be3d2d4f Added some feature 9bf0f2730234e savepoint << Pushed here 240e1ce8893e9 Add ignore rule 01462e889d416 savepoint 6238e3b775027 Fixed Something << Pushed here 0

我有几个“保存点”提交,希望将它们压缩成更具可读性的时间线。以下是我的情况:

> git log

29a94be3d2d4f Added some feature
9bf0f2730234e savepoint          << Pushed here 
240e1ce8893e9 Add ignore rule
01462e889d416 savepoint
6238e3b775027 Fixed Something    << Pushed here
0d485486a42a9 Update Version
......
06ad9e4fc5f64 savepoint
1462e57657434 Initial Commit
有没有一种方法来编写这个脚本,所以我可以说:


git squash-COMMIT with log=“savepoint”~ FROM_INITIAL_COMMIT
更新:技巧似乎在
git_SEQUENCE_编辑器中
variable

更新:技巧似乎在
git_SEQUENCE_编辑器中
variable

你的
让我想起了什么,但它并不完全适用于您的情况。您的
让我想起了什么,但它并不完全适用于您的情况。对此进行扩展,是一个冗长的答案,它使用
GIT\u SEQUENCE\u EDITOR
自动使用
GIT rebase-i
挤压类似的提交。要扩展它,是一个很长的答案,它使用
GIT_SEQUENCE_EDITOR
自动使用
GIT-rebase-i
压缩类似的提交。
29a94be3d2d4f Added some feature
240e1ce8893e9 Add ignore rule
6238e3b775027 Fixed Something
0d485486a42a9 Update Version
1462e57657434 Initial Commit