Most people write commit messages explaining in short what is in their commit, which in the long run tells other people NOTHING about the commit without having to go through the
diff of the commit. But there is a better way to do this. When committing and writing a message, like this:
git commit -m "Some very long commit message that ruins everything when exceeding 50 characters"
You’re exceeding 50 character limit Git has for commit messages. The rest goes to the commit message details.
You should always get the commit message dialog by writing
git commit. Then write a 50 character (or less) description explaining what is in your commit. Then after 50 characters, you go into more details why you made this commit.
A little example:
Here I am just going into the commit message dialog.
Here I am in the commit message dialog.
Press the keyboard key
i to get into INSERT mode of vim. Then you write some message, like so:
Notice how the word
everybody is grayed out. That’s because it is beyond the 50 character limit. So everything after 50 characters becomes „details“ in the commit message.
So, after writing a short message in the yellow field explaining the WHAT in your commit message, press enter twice to get into the details (gray) field, and write more details, explaining the WHY of your commit.
Something like this: