xxxxxxxxxx
# Check the differences between the last two commits
$ git diff HEAD~1 HEAD
# Check the differences in staged changes (changes ready for commit)
$ git diff --staged
xxxxxxxxxx
git status
git diff
git show abcdef1
# Check the differences between the last two commits
$ git diff HEAD~1 HEAD
# Check the differences in staged changes (changes ready for commit)
$ git diff --staged
# Check the differences between the two branches
$ git diff feature-branch..main
# Check the differences between the current state and the initial commit
$ git diff HEAD~1
# Check the differences between the last two commits
$ git diff HEAD~2 HEAD~1
# Check the differences in file1.txt
$ git diff file1.txt
# Check the differences for the specific file between the two branches
$ git diff main..feature-branch -- sample.txt
# Check the differences for the specific file between the first and last commits
$ git diff HEAD~2 HEAD -- sample.txt
# Check the differences with context lines
$ git diff -U3
# Check the word-level differences
$ git diff --word-diff
# Check the differences with color highlighting
$ git diff --color
xxxxxxxxxx
git diff
# Check the differences between the last two commits
$ git diff HEAD~1 HEAD
# Check the differences in staged changes (changes ready for commit)
$ git diff --staged
# Check the differences between the two branches
$ git diff feature-branch..main
# Check the differences between the current state and the initial commit
$ git diff HEAD~1
# Check the differences between the last two commits
$ git diff HEAD~2 HEAD~1
# Check the differences in file1.txt
$ git diff file1.txt
# Check the differences for the specific file between the two branches
$ git diff main..feature-branch -- sample.txt
# Check the differences for the specific file between the first and last commits
$ git diff HEAD~2 HEAD -- sample.txt
# Check the differences with context lines
$ git diff -U3
# Check the word-level differences
$ git diff --word-diff
# Check the differences with color highlighting
$ git diff --color