This started happening without any clear reason:
Pic is from Source Tree GUI, but the same issue can be seen in the terminal view.
My intuition is that it has something to do with line endings, but I don't know how to confirm it.
Suggestions?
Probably you're using an editor that automatically removes trailing whitespace. When you've edited the file earlier with an editor that keeps trailing whitespace on newlines (to keep indentation) this behavior may occur.
EDIT: You may also be able to ignore whitespace changes in github by appending ?w=1 to the url (https://github.com/blog/967-github-secrets)