Git: Origin vs Upstream

Upstream mostly refers to the original repo that you have forked.

Origin refers to the forked repository. Most often this is the repository that you cloned. (assuming that you forked the upstream and clone the forked repository instead of cloning directly the upstream)

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

so when we do git pull or git push then by default it will go to origin.

Leave a Reply

Your email address will not be published. Required fields are marked *