相关疑难解决方法(0)

我应该在哪里放置我的全局'gitattributes'文件?

我收集了(尽管缺乏文档)一种在全球范围内设置Git属性的方法 ; 但我不清楚在哪里放置必要的gitattributes文件.该说明称,他们属于中

$(prefix)/etc/gitattributes
Run Code Online (Sandbox Code Playgroud)

但是在哪里$(prefix)?特别是OS X(Git in /usr/local/git/bin/git)的用途是什么?或者(或另外)可以~/.gitattributes 工作吗?

unix git path gitattributes

49
推荐指数
1
解决办法
3万
查看次数

为什么 git 对标记为二进制的文件发出 CRLF 警告?

我有一个已标记为二进制的文件:

$ 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)

git

5
推荐指数
1
解决办法
1994
查看次数

标签 统计

git ×2

gitattributes ×1

path ×1

unix ×1