Creating an empty commit

Download git eBook

Example

Generally speaking, empty commits (or commits with state that is identical to the parent) is an error.

However, when testing build hooks, CI systems, and other systems that trigger off a commit, it's handy to be able to easily create commits without having to edit/touch a dummy file.

The --allow-empty commit will bypass the check.

git commit -m "This is a blank commit" --allow-empty

Stats

Contributors: 2
2016-07-22
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook