Assuming "current version" is the working directory (uncommitted modifications) and "last version" is HEAD
(last committed modifications for the current branch), simply do
git diff HEAD
Credit for the following goes to user Cerran
.
And if you always skip the staging area with -a
when you commit, then you can simply use git diff
.
Summary
git diff
shows unstaged changes.git diff --cached
shows staged changes.git diff HEAD
shows all changes (both staged and unstaged).Source: git-diff(1) Manual Page – Cerran