Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+2 votes
3 views
in DevOps and Agile by (29.3k 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 (50.2k 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

Related questions

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...