smbrine
smbrine

Reputation: 1

How to commit without message in Git?

I know that GitHub highly recommends to use messages BUT I work on semi-public projects with my brother and we are working in the same room so obviously we don't need any comments to our commitments. Are there any other options to completely disable commitment messages at least for the specific repository/project/file?

I found this command to make a single commitment: git commit -a --allow-empty-message -m "" and it works pretty well but I'm already tired of typing it every time.

Upvotes: 0

Views: 687

Answers (1)

Liam McArthur
Liam McArthur

Reputation: 1033

I'm not entirely sure why you would want to commit without a message every time since the whole idea of Git is to track code. You'll probably want to create an alias for the command to prevent you having to type it every time.

I haven't tested this, but something like:

git config --global alias.cm "commit -a --allow-empty-message -m ''"

then you would run git cm instead. See here for more information on aliases.

Upvotes: 5

Related Questions