You should use remote
s:
git remote add upstream https://path-to-original.repo
Note that the name upstream
can be anything you like. After adding a remote
, running git fetch upstream
helps you:
Fetch branches and/or tags (collectively, "refs") from one or more
other repositories, along with the objects necessary to complete their
histories.
fetch
is necessary if you for example don't have some branches of the upstream
.
Now you can pull (assuming you are on the same branch) using:
git push upstream master
Now to compare your for example master
with master
of remote you would write something like this:
git diff master upstream/master
You could list all of your remote
s using:
git remote -v