+2 votes
1 view
in Devops and Agile by (24.5k points)
edited by

What is the difference between origin and upstream on GitHub?

When a git branch -a command is done, some branches have a prefix of origin (remotes/origin/..) while others have a prefix of upstream (remotes/upstream/..).

1 Answer

+1 vote
by (41.8k points)

Original definition from the documentation:

When a repo is cloned, it has a default remote called origin that points to your fork on GitHub, not the original repo it was forked from.

To keep track of the original repo, you need to add another remote named upstream

Upstream generally refers to the original repo that you have forked

(see also "Definition of “downstream” and “upstream” " from:

https://intellipaat.com/community/10411/definition-of-git-upstream-and-downstream?show=10983#a10983)

Origin is your fork: your own repo on GitHub, a clone of the original repo of GitHub

...