I was wondering if it is possible to push all my local commits (all 'unpushed' commits of the day) to the remote repository as a single commit with a custom message. None of the posts on Stack Overflow seem to answer this. I'm using Git Bash on Windows.
Thanks in advance.
Use git rebase -i HEAD~N
where N
is <the number of your commits> + 1
(to be on the safe side). You will need to mark all your commits but the first one as s
(stands for "squash") and save/quit the editor. It will ask you for the commit message for the final squashed commit - specify one, and you are done.
What you want to do is called "squash". Take a look here:
https://makandracards.com/makandra/527-squash-several-git-commits-into-a-single-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