1

In a particular repository, I have unstaged changes in tracked files. When I run git diff in that folder, I get no output(and no error). However, if I use gitk(as myself) or run git diff as root, I can see the changes.

I've tried removing my ~/.gitconfig and all zsh config files, and also with bash.

jck
  • 1,910
  • 4
  • 18
  • 25
  • What do you see in `git status`? Check your `.gitignore`s. – SLaks Jan 12 '14 at 23:19
  • Does it happen for a new repo? Just run `git init`, `echo hello>test.txt`, `git add test.txt`, `git commit -m "hi"`, `echo world>>test.txt`, then check `git diff` – CharlesB Jan 12 '14 at 23:19
  • @slaks: Git status shows that the file has been modified. I doubt its a gitignore issue since it works with gitk and in shell as root. – jck Jan 12 '14 at 23:21
  • Can you check ownership (and permissions) of files in the `.git` directory using `ls -alR`? – krlmlr Jan 12 '14 at 23:22
  • @CharlesB I'm experiencing the same problem with a new repository. – jck Jan 12 '14 at 23:24
  • @krlmlr All the files are owned by me. – jck Jan 12 '14 at 23:25

1 Answers1

4

It might be a problem with the pager (usually more or less) Git uses for outputing the diff.

Use git --no-pager diff, and check your PAGER environment variable.

Reference: How do I prevent git diff from using a pager?

Community
  • 1
  • 1
CharlesB
  • 86,532
  • 28
  • 194
  • 218