1
0 Comments

Lets play a game! How many Git commits do you have with 1 word commit messages?

Run these command in one of your git repositories:

git log --pretty=%s | wc -l
Result: 104

git log --pretty=%s | grep -v "\s" | wc -l
Result: 0


To explain what the commands do:

git log --pretty=%s
Lists all of your commit messages:

grep -v "\s"
Filter output of the above command to only lines without whitespace

wc -l
Counts the number of filtered lines

What did you get?

on April 8, 2020