前提 :
環境はwindows
git bash install済み
min.css,min.jsなどの一行もののファイルではない。
以下ブランチが存在し developがおかしい場合の例
master
develop
masterで文字コード確認 これはlf
$ file index.html
index.html: HTML document, Unicode text, UTF-8 text, with very long lines (421)
developに移動
$ git switch develop
Switched to branch 'develop'
Your branch is up to date with 'origin/develop'.
developで改行コード確認 CRLFとなっていた
$ file index.html
index.html: HTML document, Unicode text, UTF-8 text, with very long lines (421), with CRLF line terminators
masterがlf , developがcrlfなのでdevelopの改行コードがおかしい
developの改行コードを以下で変換し push
$ dos2unix index.html
dos2unix: converting file index.html to Unix format...
以下コマンドにて改行コードの変換を無視することもできる
git config --global core.autocrlf false