As mentioned previously, the file has not changed, just that Windows and Linux expect different line endings.
This is what worked for me using Powershell, converting Linux line-endings to Windows line-endings:
- name: convert line endings from Linux to Windows (PowerShell)
win_shell: '(Get-Content "filename_from") -replace "`n", "`r`n" | Set-Content "filename_to.txt"'
The reason I needed to do this was that I was checking out text files on Linux, then copying them to a Windows server.
But the problem is, Git automatically ensures files have the "right" line-endings during checkout (meaning "right" for the machine doing the checkout, not the machine the file's copied to.)
Cheers,
Nick