This can also happen if you have this restriction:
Please enter the commit message for your changes. Lines starting with '#' will be ignored, and an empty message aborts the commit.
and you do like me: write a commit message starting with "#" .....
I had the same error, but I already had the commit-msg
and did the rebase
and everything. Very silly mistake though :D