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

前端 未结 15 1914
轻奢々
轻奢々 2020-12-12 11:37

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 clon

15条回答
  •  不知归路
    2020-12-12 12:16

    I had this same problem described in the following way: If I typed

    $ git diff
    

    Git simply returned to the prompt with no error.

    If I typed

    $ git diff 
    

    Git simply returned to the prompt with no error.

    Finally, by reading around I noticed that git diff actually calls the mingw64\bin\diff.exe to do the work.

    Here's the deal. I'm running Windows and had installed another Bash utility and it changed my path so it no longer pointed to my mingw64\bin directory.

    So if you type:

    git diff
    

    and it just returns to the prompt you may have this problem.

    The actual diff.exe which is run by git is located in your mingw64\bin directory

    Finally, to fix this, I actually copied my mingw64\bin directory to the location Git was looking for it in. I tried it and it still didn't work.

    Then, I closed my Git Bash window and opened it again went to my same repository that was failing and now it works.

提交回复
热议问题