git status shows that I have 2 commits
# On branch production
# Your branch is ahead of 'origin/production' by 2 commits.
#
but git diff shows nothing
git diff
doesn't, by default, show you anything from previous commits. You should use git log
for that. To show the last two commits, use git log -2
.
To compare commits with each other using diff, the syntax is git diff commit1 commit2
. For example, to show you all the changes that occurred between two commits ago and now, type git diff HEAD^2 HEAD
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With