LoginSignup
0
0

More than 3 years have passed since last update.

warning: CRLF will be replaced by LF in hoge.png.

Posted at

git で某リポジトリを clone してきたところ、

warning: CRLF will be replaced by LF in hoge.png
The file will have its original line endings in your working directory

といった警告が git status でたくさん出てきた。改行コードの設定ということで検索すると、git config autocrlf false で直る、と出てくるのだがやってみても一向に改善しない。
落ち着いてよくメッセージを眺めると、警告の出ているファイルは画像(といくつかのオフィス文書)だ。つまり、テキストじゃないから無視して、と git に伝えられればいいはずだ。

ということで正解は attributes。
https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes

.gitattributesに設定されていた内容がこちら。

* text eol=lf

そのままここに必要な設定を加えてもいいのだが、主に pull しかしないリポジトリでコミットすると管理が面倒なので、.git/info/attributes の方に書くことにする。

*.png binary
*.pptx binary
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