简体   繁体   中英

Using Ubuntu subsystem on Windows made entire GIT repository modified

I installed Ubuntu subsystem on my Windows 10. Everything was fine until I went to see my local git repository for changes, after git checkout my entire project was marked modified. This is my output of git diff .

you might have to set the line-ending for Git (on Linux) to Windows (or keep them "native", as checked out)... when overwriting Windows line-endings with Linux line-endings, the result looks about like this. just revert and then configure Git before checking out again:

git config --global core.autocrlf input

one can also define all of that (even for specific file-types) with a .gitattributes file.

alternatively, commit those line-endings to the local repo and then use a text-editor, which does support them... meanwhile even the infamous Notepad has received an update, to be able to do that (most editors come with a small line-feeds/text-encoding indicator, to the bottom-right). also see dealing with line-endings (in case autocrlf should not work as excepted).

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