Git: Line endings are not reloaded with git reset after reconfiguration

Viewed 72

I developing some code with docker on windows. I had some problems with git and the line endings/symlinks. Git automatically changes the line endings on different systems. But the docker image is an ubuntu version. Therefore they have to be the same. After configuring some settings in the local repo, I could fix the problem.

   git config core.symlinks true
   git config core.autocrlf input
   git reset --hard HEAD

But the reset does not reload the files. They have still \r line endings. Only if I delete all files and do a git stash, they have the right ending. Is there a git command to force a file to reload for all files?

1 Answers

This may be cached in index entries until file is actually changed. If git does not see change in the file it does not do anything. You should somehow make the file change. For example, by emptying the index:

git config core.symlinks true
git config core.autocrlf input
git read-tree --empty
git reset --hard HEAD
Related