---
title: "How to Push Empty Git Commits"
url: "https://florea.xyz/how-to-push-empty-git-commits/"
date: "2022-01-17T20:30:00+02:00"
updated: "2022-01-17T20:37:39+02:00"
author: "Bogdan Florea"
topic: "Programming"
---

# How to Push Empty Git Commits

### Why would you do it?

Well, because you might need to trigger a build without making any changes to your project... and you might not have access to trigger the build manually.

### How would you do it?

It's like pushing a normal commit, except you add the `---allow-empty` flag.\
So the entire command becomes:

```bash
git commit --allow-empty -m "Empty commit"
```

### Git aliases

You could shorten the command with git aliases, which allow you to create shortcuts for frequently used git commands.\
To setup a new git alias:

```bash
git config --global alias.empty 'commit --allow-empty -m'
```

Now, instead of writing `git commit --allow-empty -m "Empty commit"` you could simply use `git empty "Empty commit"` and be done.

Will soon write a more in-depth article about **git aliases**.
