1

I'm having a weird issue with Git inside a VS Code Dev Container: when I open a project folder, Git shows a bunch of already committed files as "modified" (even though I didn’t change anything)

enter image description here

But as you can see, there are no actual changes

I've tried to do

git config core.autocrlf false
git config core.filemode false

But nothing changed

2
  • 3
    Try running git diff to get git to show you the differences. Editors can get confused, especially about line endings. Commented Apr 19 at 8:03
  • 1) Does your repo have a .gitattributes file with any line ending settings? 2) After changing the autocrlf settings, have you tried git add --renormalize <files_showing_as_modified>? Commented Apr 24 at 7:00

1 Answer 1

0

I get this a lot working between Windows 11 and Linux dev containers addng a .gitattributes file to handle the line endings normally works for me.

.gitattributes

*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.