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…
bash
git diff ORIG_HEAD..HEADSee only that specific file
bash
git diff ORIG_HEAD..HEAD -- src/crypto/x509/test.pySee a summary first
bash
git diff --stat ORIG_HEAD..HEADThen inspect the full changes:
bash
git diff ORIG_HEAD..HEADIf the pull created a merge commit
bash
git show --statUseful 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.pyUse --name-only instead
bash
for f in $(git diff --name-only ORIG_HEAD..HEAD); do
git diff ORIG_HEAD..HEAD -- "$f"
doneBetter: 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"
doneAfter git pull, show me all the actual changes file-by-file
bash
git diff ORIG_HEAD..HEADbash
for f in $(git diff --name-only ORIG_HEAD..HEAD); do
echo
echo "========== $f =========="
git diff ORIG_HEAD..HEAD -- "$f"
donegit/git-diff.md
Related articles
- GitGit PullBreakdown Updating 1accfd5..b22e649 Your local branch was at commit 1accfd5. After pulling, it moved to commit b22e649. Fast-forward Git did not create a merge commit. Your local…
- GitTo see committed idTo see committed id — notes from the Git collection.
- GitGit SubmodulesA practical guide to adding, updating, moving and removing Git submodules.
- GitChange global editor to edit merging etcChange global editor to edit merging etc — notes from the Git collection.