I want to compare the local clone of a repository I have forked with the original/upstream repository to see if further commits have been made requiring me to pull/merge. I\'d l
Before one can run a git diff
between one's own local repo and the upstream, one must first fetch the upstream repo. The comparison is then made locally.
git fetch upstream
This does not affect the working branch of your repo but it does add a whole other bunch of "remote" branches, which you can see with git branch -a
.
Once you've got those, use:
git diff master upstream/master
This will compare the local repository you have with any updates that have been made to the original repository. Variations on this command will deal with updates you may have made to your own branch or check against a common ancestor (e.g., git diff master...upstream/master
) as usual.