Skip to content
Knowledge Base

See the diff introduced by the latest pull

See only that specific file See a summary first Then inspect the full changes: If the pull created a merge commit Useful workflow Use --name-only instead Better: let Git handle…

Updated 1 min readGit

bash
git diff ORIG_HEAD..HEAD

See only that specific file

bash
git diff ORIG_HEAD..HEAD -- src/crypto/x509/test.py

See a summary first

bash
git diff --stat ORIG_HEAD..HEAD

Then inspect the full changes:

bash
git diff ORIG_HEAD..HEAD

If the pull created a merge commit

bash
git show --stat

Useful workflow

bash
git pull

# Summary of what changed
git diff --stat ORIG_HEAD..HEAD

# Full diff
git diff ORIG_HEAD..HEAD

# Specific file
git diff ORIG_HEAD..HEAD -- src/crypto/x509/test.py

Use --name-only instead

bash
for f in $(git diff --name-only ORIG_HEAD..HEAD); do
    git diff ORIG_HEAD..HEAD -- "$f"
done

Better: let Git handle filenames safely

If filenames can contain spaces, use:

bash
git diff --name-only -z ORIG_HEAD..HEAD |
while IFS= read -r -d '' f; do
    git diff ORIG_HEAD..HEAD -- "$f"
done

After git pull, show me all the actual changes file-by-file

bash
git diff ORIG_HEAD..HEAD
bash
for f in $(git diff --name-only ORIG_HEAD..HEAD); do
    echo
    echo "========== $f =========="
    git diff ORIG_HEAD..HEAD -- "$f"
done
git/git-diff.md