When I want to squash some commits by interactive rebase
:
git rebase -i HEAD~3
And then:
pick cbd03e3 Final commit (signed) s f522f5d bla-bla-bla (signed) s 09a7b7c bla-bla (signed) # Rebase c2e142e..09a7b7c onto c2e142e ...
The final commit haven't gpg-signature despite that all of those commits have same signature. Is it possible to retain commit gpg-signature after interactive rebase squash?
To save your changes and exit the document, type :wq! and press Enter key. It should appear at the end of the document like this. To exit the document without saving, type :q! and press Enter key.
Squash commits together. Two other commands rebase interactive offers us are: squash ( s for short), which melds the commit into the previous one (the one in the line before) fixup ( f for short), which acts like “squash”, but discards this commit's message.
you can abort the rebase by deleting the entire contents of the editor window and saving it, or causing the editor to close with an error code. In vim this can be accomplished with d SHIFT+g followed by :wq , or alternatively causing the editor to exit with an error as Mike H-R pointed out out using :cq .
(drop) — If you remove a commit from the interactive rebase file, or if you comment it out, the commit will simply disappear as if it had never been checked in. Note that this can cause merge conflicts if any of the later commits in the branch depended on those changes.
Like Cupcake stated, you can't retain the old signature from the unsquashed commits, but you can sign the new squashed commit if you rebase like this:
git rebase --interactive [email protected] HEAD~4
Adding [email protected]
as an argument will sign the final squashed commit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With