S
S
Svyatoslav Khusamov2018-05-28 10:04:18
git
Svyatoslav Khusamov, 2018-05-28 10:04:18

Why doesn't git show file changes with diff?

On command status it shows that there are changes in the file. But the diff command does not show these changes. They are not visible in the IDE either. If you make a patch, then the patch file is empty (0 bytes).
But there are definitely (or were) changes there. There were previously removed two lines.
How to see changes?

>git status
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        modified:   src/index.ts
        modified:   src/test/Ext/Manager.spec.ts


>git diff src/test/Ext/Manager.spec.ts

>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
youngmysteriouslight, 2018-05-28
@khusamov

git-diff shows uncommitted changes by default. After git-add changes go into "Changes to be committed" and don't show up in git-diff.
However, if you do,
you will see all the changes between the previous revision and the current state of the working directory.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question