In this blog, you will learn everything about setting up an upstream for a git repository, a branch and the --set-upstream-to command usage You will also learn about different scenarios where git upstream is used and how to apply it in your git development workflow. Have you wondered how to keep the forked repo in sync with the main repo?

When you clone a Forked repository to your local, the forked repository is considered as the remote origin, and the repository you forked from is upstream.

When you have a branch (named foo) in your local repository and want to add an upstream branch for tracking, you can use the following command.

Related Articles