I would like to be able to squash the last n commits that have a commit message of 'squash commit' into a single commit from a node.js script. The only way that I know of to squash commits is through an interactive rebase, is there a way to do this from a node script?
Ex:
> 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.
Going off of this SO post, https://stackoverflow.com/a/5956198/626759, I could get to the interactive rebase easily enough, but how could I work with that from a node script?
Thanks.