How to determine which files are behind origin/branch in Git

All PostsPosts filtered by: so notes

How to determine which files are behind origin/branch in Git

Updated: May 7, 2015 by Tony Alves

Original:on Stackoverflow

To see what commits have been added to the upstream master, run a git log using origin/branch as a filter. Will show the commits.

git fetch
git log --oneline master..origin/branch

example output:
2d8ad7d fix a whole bunch of stuff
c1ee8ec updated some values

Then use the commit id to view the files of a commit.

git diff --no-commit-id --name-only -r 2d8ad7d

or

git diff --stat -r 2d8ad7d

Note: This example and your solution is tracking the remote branch origin/branch. If you are tracking a different branch, replace that branch name in the command above.

© Tony Alves