Last Updated: January 23, 2024
·
468K
· dmichaelavila

git commit --allow-empty

Sometimes I need to make empty commits on throw away branches so that I can trigger various kinds of things for a variety of different reasons. As an example, today I wanted to test integration between GitHub and Flowdock. Once I thought I had the two configured correctly I made the following commit:

$ git commit --allow-empty -m "Trigger notification"

More convenient than adding spaces to your README!

Note I obviously made this commit to a branch other than master. In my situation above I used a branch named throw-away