Unless otherwise stated, we're using Git v2.x
WIP Alert This is a work in progress. Current information is correct but more content may be added in the future.
Compare working directory with remote branch
git fetch --allfirst so your local remotes are synced with the remotes
Suppose you have a local directory with unmerged changes and you want to compare it with a branch on github.
Suppose the other branch you want to compare against is called
origin is a remote pointing to github.
$ git fetch --all $ git diff origin/my-other-branch
Compare two arbitrary branches