An Empty Commit Is A Useful Commit!
Sometimes you need to perform a GIT commit without changing any file in the repository:
- For triggering a new build
- For testing the workflow (GIT hooks, builds, releases, etc.)
GIT commit has a special command switch for this purpose:
This switch performs a simple commit with no files changes but with a complete GIT object as of a regular commit.
For example, the following command:
git commit –allow-empty -m “Empty test commit”
creates the following object (screenshot from Atlassian SourceTree):
Simple and useful…
Yoram Michaeli - email@example.com
We will contact you as soon as possible.