git-diff: Only show changes staged for committing

You can use git diff --staged (or git diff --cached) to see the diff that will be used when committing.

From the manpage:

git diff [--options] --cached [<commit>] [--] [<path>...]
This form is to view the changes you staged for the next commit relative to the named <commit>. Typically you would want comparison with the latest commit, so if you do not give <commit>, it defaults to HEAD. If HEAD does not exist (e.g. unborned branches) and <commit> is not given, it shows all staged changes. --staged is a synonym of --cached.

Leave a Comment

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