Last Updated: October 04, 2020
· italolelis

git: Show difference between local and remote branches

Sometimes we need to know which files will be pulled to our working tree from the remote repository. To do that just run:

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

The git fetch command will fetch all changes that happened in the origin. And the git diff will show us the differents files between our working tree and the remote.

Related protips:

Remove all your local git branches but keep master