【发布时间】:2016-07-27 04:49:40
【问题描述】:
当我像这样结帐 curl 时:
git clone https://github.com/bagder/curl.git
我得到(没有做任何事情)2个修改过的文件:
> git status
Your branch is up-to-date with 'origin/master'.
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: winbuild/Makefile.msvc.names
modified: winbuild/MakefileBuild.vc
no changes added to commit (use "git add" and/or "git commit -a")
即使我尝试像这样签出这些文件:
git checkout winbuild/Makefile.msvc.names
它们仍然被修改。对git diff -R 的调用表明它可能与行尾有关,因为差异显示^M 附加到每一行。
由于在cmets中提示,问题与.gitattributes文件有关,这里是:
*.dsw -crlf
buildconf eol=lf
configure.ac eol=lf
*.m4 eol=lf
*.in eol=lf
删除我的 gitconfig 并没有改变这种情况,所以我想这与此无关。
顺便说一句,我在 ubuntu linux 上。
【问题讨论】:
-
您使用的是 Linux 吗?应该是行尾问题。检查
git diff -R并查看这些文件是否被^M at the end of each line 替换。我希望这个 repo 的 .gitattributes 需要修复。 -
@hinerm 你似乎是对的。我在问题中添加了相关信息,但我仍然不知道如何解决这个问题
标签: git