To compare the production with the last commit:
git diff --cached git diff --staged
Both teams give the same results, right?
The documentation for git diff says: --staged is synonymous with -cached , so yes.
git diff
--staged
-cached
From docs - --staged is synonymous with --cached
git-scm.com/docs/git-diff :
git diff [<options>] --cached [<commit>] [--] [<path>…]This form is designed to view the changes that you have made for the next commit regarding a named <commit> . Typically, you want a comparison with the last commit, so if you don't give it, the default is HEAD. If HEAD does not exist (for example, unborn branches) and is not set, it shows all phased changes. --staged is synonymous with --cached .
git diff [<options>] --cached [<commit>] [--] [<path>…]
This form is designed to view the changes that you have made for the next commit regarding a named <commit> . Typically, you want a comparison with the last commit, so if you don't give it, the default is HEAD. If HEAD does not exist (for example, unborn branches) and is not set, it shows all phased changes. --staged is synonymous with --cached .
<commit>