For me what did the trick was running the command
git config auto.crlf false
inside the folder of the project, I wanted it specifically for one project.
That command changed the file in path {project_name}/.git/config (fyi .git is a hidden folder) by adding the lines
[auto]
crlf = false
at the end of the file. I suppose changing the file does the same trick as well.