Fixing line endings in Git on Windows

I am currently working with Github and an Ubuntu VM under Windows. Because of line endings, while the command line in Windows shows the repository is up to date without modifications, that in Ubuntu shows a lot of files modified. I have successfully fixed this issue with:

git config --global core.autocrlf true

Source: