markmcdermott.io (js, ruby, ...etc) by mark mcdermott

Viewing Git Changes

Both Filenames & Diffs

06/15/2025

read time:1 min

This blog has answers for the following scenario. I’m on a local dev branch and have committed my changes. I want to see:

Filenames With Changes (local)

git diff --name-only master

Diffs of Files With Changes (local)

git diff master

Filenames With Changes (remote)

git fetch origin master
git diff --name-only origin/master

Diffs of Files With Changes (remote)

git fetch origin master
git diff origin/master

Bonus: Compact Change Summary

git diff --stat master         # local  
git diff --stat origin/master  # remote (git fetch origin master first)