Make an empty git commit

May 11, 2016

Occassionally I have need to mark a specific moment in a git repository. Often this mark is to call out a deployment point. If everything has already been committed I will use an “empty commit” as a marker. Git makes this quite easy and in fact it is built into the commit command.

Run the following and your commit editor of choice will open to provide the commit message:

git commit --allow-empty

Alternatively you can provide the commit message inline with the standard -m

git commit --allow-empty -m "New commit message"
Leave a Reply

Your email address will not be published. Required fields are marked *