Github Desktop converting files from CRLF to LF (batch files)

Hello, today I made a commit to my repository
the commit included a .cmd file which had a batch script in it

and I had another script which downloads the file I committed using curl and it starts the file
now the problem is that I had an error which it seems that the file has not been fully loaded

The ERROR: The system cannot find the batch label specified - JsonParse
the label exists in the file but it doesn’t know it due to the LF conversation

What can I do to make github desktop not to convert the file from CRLF to other types?

(currently I uploaded the file to github.com and it works but I do want to continue using github desktop)

I’m not sure if it’s really the GUI application or Git under the hood that messes with the line endings here. Anyhow, you may try the following:

  1. Paste *.cmd text eol=crlf into a new file in VSCode
  2. Save it as .gitattributes to the root folder of your working copy (make sure that it doesn’t end up with a .txt extension or the like)
  3. Open the script file and ensure that it has Windows line endings (CRLF) in your working copy. If it doesn’t, change it via the VSCode status bar and save the changes.
  4. Add the new file, commit the changes, and push them to the remote repository.
  5. Check if the script gets downloaded with the correct line endings