'How can I compare my local forked repository with changes that may have been made to the original?
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 like to do this from the command line.
I added the original repository to my list of remotes with this command:
git remote add upstream <original repo URL>
This is outlined in Github's own page on the topic of forking a branch.
However, when I run git diff upstream or git diff upstream/master as advised here or git diff master upstream/master as advised here, I get this:
fatal: ambiguous argument 'upstream': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
The command git diff origin/master does not return an error (or anything for that matter). Have I missed something?
Solution 1:[1]
I want to compare the local clone of a repository I have forked with the original/upstream
In May 2022, that comparison can be done online on GitHub:
Compare differences between branches
We've added an enhancement to the repository view for a branch that is different than its upstream branch.
Previously we showed the number of commits the branch was ahead or behind the upstream, but there wasn't an easy way to show the differences.Now you can click a link that takes you to a comparison page to see the differences.
Note: there is a different link for ahead versus behind
aheadrepresents changes your branch has but the upstream branch does notbehindrepresents changes the upstream branch has but your branch does not
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | VonC |

