'git status' shows changed files, but 'git diff' doesn't

10/14 05:05
阅读数 0

问题:

I've had a look at all similar questions.我看过所有类似的问题。 However, I've double checked and something strange is definitely happening.但是,我已经仔细检查过,肯定会发生一些奇怪的事情。

On one server (Solaris with Git 1.8.1) I cloned the Git repository then copied the .git folder into my existing live files.在一台服务器(带有 Git 1.8.1 的 Solaris)上,我克隆了 Git 存储库,然后将 .git 文件夹复制到我现有的实时文件中。 This worked perfectly, I could run这工作得很好,我可以运行

git status

then然后

git diff [filename]

to check any files that were different.检查任何不同的文件。

On another server (Solaris with Git 1.7.6) I'm doing exactly the same however在另一台服务器(带有 Git 1.7.6 的 Solaris)上,我做的完全一样

git diff [filename]

shows nothing, even if the contents of the file is definitely different.即使文件的内容肯定不同,也不会显示任何内容。 I have also tested adding a new file, committing it, and then editing.我还测试了添加一个新文件,提交它,然后进行编辑。 The same issue, git status shows the file as changed, but git diff shows nothing.同样的问题, git status显示文件已更改,但git diff什么也没显示。 If I download the changed file and run a diff locally then I get diff output.如果我下载更改后的文件并在本地运行差异,那么我会得到差异输出。


解决方案:

参考一: https://en.stackoom.com/question/z70U
参考二: https://stackoom.com/question/z70U
展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部