How to see changes to a file before commit?

To see all the diff in tracked files but not staged:

git diff

or

git diff path/to/a/given/file

to see the diff only for a file. You can also see the diff in a given sub-directory of your project:

git diff path/to/a/dir/

If you have already staged the changes with git add, you can see what patch you have staged with

git diff --staged

You can also specify a path with --staged.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)