在Git克隆后直接显示为已修改的文件 [英] Files showing as modified directly after a Git clone

查看:120
本文介绍了在Git克隆后直接显示为已修改的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我的存储库有问题,尽管我的Git-fu通常很好,但我似乎无法解决此问题.

I'm having an issue with a repository at the moment, and though my Git-fu is usually good, I can't seem to solve this issue.

当我克隆此存储库时,然后cd进入存储库,git status会显示多个已更改的文件.注意:我尚未使用任何编辑器或任何工具打开存储库.

When I clone this repository, then cd into the repository, git status shows several files as changed. Note: I haven't opened the repository in any editor or anything.

我尝试遵循此指南: http://help.github.com/dealing-with -lineendings/,但这对我的问题完全没有帮助.

I tried following this guide: http://help.github.com/dealing-with-lineendings/, but this didn't help at all with my issue.

我已经尝试过很多次git checkout -- .,但是似乎什么也没做.

I have tried git checkout -- . many times, but it seems not to do anything.

我在Mac上,存储库本身没有子模块.

I'm on a Mac, and there are no submodules in the repository itself.

在Mac上,文件系统是"Journaled HFS +"文件系统,不区分大小写.这些文件为单行,每个文件约为79KB(是的,您没听错),因此查看git diff并不是特别有用.我听说过做git config --global core.trustctime false这可能会有所帮助,当我回到上面有存储库的计算机时,我会尝试尝试.

The filesystem is "Journaled HFS+" filesystem on the Mac and is not case-sensitive. The files are one-line and about 79 KB each (yes, you heard right), so looking at git diff isn't particularly helpful. I have heard about doing git config --global core.trustctime false which might help, which I will try when I get back to the computer with the repository on it.

我用事实改变了文件系统的细节!然后我尝试了效果不佳的git config --global core.trustctime false技巧.

I changed details of filesystem with facts! And I tried the git config --global core.trustctime false trick which didn't work very well.

推荐答案

我明白了.我认为所有其他开发人员都在Ubuntu上,因此具有区分大小写的文件系统.但是,我却没有(因为我在Mac上).确实,当我使用git ls-tree HEAD <path>进行查看时,所有文件都具有小写的双胞胎.

I got it. All the other developers are on Ubuntu (I think) and thus have case-sensitive file systems. I, however, do not (as I'm on a Mac). Indeed, all the files had lowercase twins when I took a look at them using git ls-tree HEAD <path>.

我会选出其中一个来解决这个问题.

I'll get one of them to sort it out.

这篇关于在Git克隆后直接显示为已修改的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆