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:

Source:
http://stackoverflow.com/questions/10418975/how-to-change-line-ending-settings