0
0

windowsにてファイルすべてが差分で競合してしまう。(改行コード疑い)

Posted at

前提 :
環境は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
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0