我希望能够从 node.js 脚本将最后 n 个具有“squash commit”提交消息的提交压缩为单个提交。我知道压缩提交的唯一方法是通过交互式变基,有没有办法从节点脚本中做到这一点?
前任:
> git log --oneline | head -4
ecce153 Do not change commit
dd831f6 squash commit
c20677a squash commit
86b52fb squash commit
> ./squash.js "New commit made by squashing 3 'squash commit' commits."
ecce153 Do not change commit
as34dwf New commit made by squashing 3 'squash commit' commits.
离开这篇 SO 帖子,https://stackoverflow.com/a/5956198/626759,我可以很容易地进入交互式 rebase,但是我怎么能从节点脚本中使用它呢?
谢谢。