'default git commit behavior to --allow-empty

I would like to get git commit to have the --allow-empty flag by default (not with an alias).

I search in the git documentation but I didn't find anything about it.

Is there any gitconfig command that can change this?



Solution 1:[1]

A quick skim of the git-commit and git-config docs does not reveal such a specific option.

However, you can specify a git alias that does this:

# the --global flag means this works now everywhere, not just in the current repo.
git config --global alias.committ "commit --allow-empty"
# Now use like this:
git committ -m "my empty commit, with a message"

While I was writing this answer, the question was edited. I am leaving this here for completeness since future visitors might be happy with this.

I gave it a try to overwrite alias.commit itself, without the additional t. This does not seem to have any effect.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 lucidbrot