Using Github Desktop, I create a new repository. I then opened Unity Hub and created a new project inside that repository (using the Git Ignore “Unity” preset), made a few changes to the scene, and attempted to make an initial commit to master using Github desktop, and I get the error (repeated for what appears to be every file in the project):
warning: LF will be replaced by CRLF in DeleteMeProject/Assets/Scenes.meta.
The file will have its original line endings in your working directory
I did some reading on line endings, and tried some git commands suggested here using Repository > Open Repository in Command Prompt, no luck.
Screenshot of the error:
Any ideas?
I figured it out.
Because my .gitignore was in a folder (that was created when I created the repo) BESIDE the Unity project folder, I needed to modify the paths in the .gitignore to reflect this so it knew where to look.
Had the same issue.
The problem was coming from having the unity editor open.
I simply closed it and I was able to commit
Paste the below code
[core]
autocrlf = false
[filter “lfs”]
required = true
clean = git-lfs clean – %f
smudge = git-lfs smudge – %f
process = git-lfs filter-process
FWIW I just ran into this on a project I just created. Solved it by simply making a change in the sample scene and saving it (I just created a cube, then deleted the cube).
Kaldrin
5
Had the same issue, your solution worked, thanks !
Fritsl
6
Erhm, you do not need to modify the file / paths, just read the top comment in the file, and move the file into the root of the project as described 
For me, I had to take my project out of the folder and put it with the .gitignore and .gitattributes. It worked without any errors.
Try this.
1- # This .gitignore file should be placed at the root of your Unity project directory
2- delete all forward slash symbols(check image).
.gitignore files cascade. I moved the .gitignore file GitHub desktop created down into the Unity project directory and it worked just fine.