我有一个已标记为二进制的文件:
$ cat .gitattributes
dist/* binary
$ git check-attr -a ./dist/app.js
./dist/app.js: binary: set
./dist/app.js: diff: unset
./dist/app.js: merge: unset
./dist/app.js: text: auto
Run Code Online (Sandbox Code Playgroud)
并git diff正确地将文件视为二进制文件:
$ git diff
diff --git a/dist/app.js b/dist/app.js
index 9c05798..fbcedd4 100644
Binary files a/dist/app.js and b/dist/app.js differ
Run Code Online (Sandbox Code Playgroud)
但是当我运行时git status,我收到有关转换的警告CRLF:
$ git status
warning: CRLF will be replaced by LF in dist/app.js.
The file will have its original line endings in your working directory.
On branch master
Your branch is up-to-date …Run Code Online (Sandbox Code Playgroud)