There is no git diff.

Asked 2 years ago, Updated 2 years ago, 45 views

Running $git diff on the local PC does not return anything.

git status returns the properly modified file.

I'm sure there's something wrong, but I can't guess.

If you have any questions, please take care of me.

git

2022-09-29 22:14

3 Answers

Maybe it's because I haven't committed yet.Even before committing

 git status-v-v

I think I was able to do something similar to diff in


2022-09-29 22:14

I think it's in the staging area.
You can use git diff if you just changed it and haven't posted it to the staging area yet.
If you are posting to a staging area and want to see the editing location, use git diff --cached
I think I can do it.
Wouldn't it be possible to check the difference now?

Reference site


2022-09-29 22:14

We recommend that you review the git status results again.
Also, if you present the results here without any problems, I think you will get a more accurate answer.

First of all, based on the current information, we can think of the following possibilities:

  • In this case, git status should display as Untracked files (*).
  • In this case, git status should display Changes to be committed ( )).
  • git diff is a command that looks at the difference between the working tree and the index, and when added to the index, there is no difference, so nothing is displayed.
  • You can use the git diff --cached command to see this difference (the difference between index and HEAD).

*The message may vary slightly depending on the version.


2022-09-29 22:14

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.