wsl中git 问题

Recoding
  • 417

一份代码先是用window中的git拉下来
但在wsl中git status却显示所有文件都被modified

Windows Subsystem for Linux
回复
阅读 5.9k
1 个回答

https://github.com/Microsoft/...

This could have something to do with WSL reporting the permissions of all files on the Windows filesystem as being 777. Git then regards all files as changed because their permissions are different.

Try changing the Git configuration so that permission changes are ignored:

# For the current repository
git config core.filemode false   

# Globally
git config --global core.filemode false

方法2

It may be line endings,WSL thinks it is linux so it will use LF as the line endings.

You can set git to only use CRLF line endings with:

git config --global core.autocrlf true
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏