git diff after modifying a tracked file?app.txt tracked by Git. You change a line in this file but do not stage it. What does git diff show?git diffgit diff compares by default when no options are given.git diff by default shows changes in the working directory compared to the index (staging area). Since the file is modified but not staged, it shows the differences between the index and the current file.
git diff --staged and git diff --cached both show differences between the index (staged files) and the last commit.
git diff show no output after modifying a file?git diff shows no output. What could be the reason?git diff compares by default.If the file is staged, git diff shows differences between working directory and index. If no changes exist in working directory (because changes are staged), it shows nothing.
First, git diff shows unstaged changes. Then git add stages them. Finally, git diff --staged shows staged changes.
git status shows staged, unstaged changes and untracked files in a clear summary, helping review before commit.
