git的在Windows下改成LF结束符的方法

因为要用docker的脚本,Windows下又默认culf,一推上去就报错一推上去就报错,就在vscode和eslint配置了默认LF,并且在git命令行打了

 git config --global core.autocrlf false

一开始其实是好了的,但是上海封城期间,不知道同事做了啥,怎么都失效了,变成一拉下来就CULF一拉下来就CULF

后来发现可以配置配置文件 .gitattributes

# # Set the default behavior, in case people don't have core.autocrlf set.
# * text=auto

# # Explicitly declare text files you want to always be normalized and converted
# # to native line endings on checkout.
# *.js text
# *.vue text
# *.sh text

# Declare files that will always have CRLF line endings on checkout.
*.js text eol=lf
*.vue text eol=lf
*.json text eol=lf
*.sh text eol=lf

# # Denote all files that are truly binary and should not be modified.
# *.png binary
# *.jpg binary

就彻底好了,不然真是要疯了

posted @ 2022-06-23 10:37  fengyujia  阅读(305)  评论(0编辑  收藏  举报