4

刚刚克隆了这个,目录立即有变化吗?

我从来没有遇到过这样的事情,我很好奇为什么会这样?这怎么可能?

更新:

git clone git://github.com/horndude77/open-scores.git我在运行 git status 后立即使用和克隆了 repo :

git status
# Not currently on any branch.
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   SaintSaensRomanceOp36/defs.ily
#       modified:   SaintSaensRomanceOp36/horn.ily
#
no changes added to commit (use "git add" and/or "git commit -a")

git diff 显示:

warning: CRLF will be replaced by LF in SaintSaensRomanceOp36/defs.ily.
The file will have its original line endings in your working directory.
warning: CRLF will be replaced by LF in SaintSaensRomanceOp36/horn.ily.
The file will have its original line endings in your working directory.
diff --git a/SaintSaensRomanceOp36/defs.ily b/SaintSaensRomanceOp36/defs.ily
index 07e09ac..c7961be 100644
--- a/SaintSaensRomanceOp36/defs.ily
+++ b/SaintSaensRomanceOp36/defs.ily
@@ -1,47 +1,47 @@
-\version "2.13.13"
.
.
.

注意:仅包含差异的顶部,因为它很长。

当我克隆存储库时是否删除了 CRLF 字符,如果是,这些字符是如何包含在对 bigin 的提交中的?

4

2 回答 2

5

克隆存储库时会自动删除在 Windows 机器上提交时包含的 CRLF 字符。然后 Git 检测到此更改,因此在克隆后立即修改存储库,用户执行了git clone.

我通过* text=auto从我的.gitattributes文件中删除来解决这个问题。

于 2012-06-08T13:59:33.233 回答
2

这是 Windows 和 Linux 之间存在差异的问题。有一个堆栈溢出问题解决了这个问题

您可以简单地通过执行以下操作来修复它:

$ git config core.autocrlf true
于 2012-06-06T02:51:05.250 回答