back to xoc3.io
2026-08-05 - git commits without messages
I've had a little git commit trick since around June 2023, that I haven't seen anyone else use, so I should share.
The trick is to write git commits with empty messages. Git supports writing commits without any messages via a commandline flag:
git commit --allow-empty-message -m ""
My two git commit shell aliases look like this:
gc () {
git add --all
git commit --allow-empty-message -m ""
}
gcm () {
git add --all
git commit
}
90% of the time when I am making git commits, it is to save progress or make a small change that explains itself.
I don't know why I was trained to write git commits with every commit before.
Anyways, for the past 3 years I just type `gc` to commit and occasionally if I want to leave a commit message, I type `gcm`.
Not sure what inspired me to write this today, but hope it helps someone.