简体   繁体   中英

Reopening in a Container in Vscode - git issue

I have a project with a .devcontainer folder with appropriate setup files. So, through Vscode I can open the project in a docker container with the configured environment for development and testing. But when I open it in a container all the files in the project are tagged as Modified. But when I change any file, save it, and open it locally then only that file is modified.

I'm not sure why this is happening and is this expected?

So, I found the answer and the issue was with different line endings conversion between Windows(local env) and the docker container. Using the following and cloning the repo again resolved the issue.

git config --global core.autocrlf false

A detailed discussion is in the link below: https://code.visualstudio.com/docs/remote/troubleshooting#_resolving-git-line-ending-issues-in-containers-resulting-in-many-modified-files

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM