0 votes
1 view
in Devops and Agile by (28.1k points)

Is there a way I can see the changes that were made to a file after I have done a git add file?

That is when I do:

git add file

git diff file

no difference is shown. I guess there's a way to see the differences since the last commit but I don't know what that is.

1 Answer

0 votes
by (48k points)

You can use --cached option which shows you the staged changes in cache/index

 git diff --cached

--staged is the synonym for --cached

In more recent versions of git, you can also use the --staged flag 

$ git diff --staged

This command will show you what is staged.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !