Git Upstream
The upstream of a branch is the remote branch it tracks, like origin/main for main. With an upstream set, a plain git pull and git push know where to go, and git status tells you if you are ahead or behind.
In a fork, upstream is also the usual name for a second remote that points to the original repository.
Set the upstream when you push a new branch
A new branch has no upstream yet. Use -u the first time you push it:
git push -u origin html-skeleton
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
branch 'html-skeleton' set up to track 'origin/html-skeleton'.
To https://github.com/w3schools-test/hello-world.git
* [new branch] html-skeleton -> html-skeleton
git status
On branch html-skeleton
Your branch is up to date with 'origin/html-skeleton'.
nothing to commit, working tree clean
Set the upstream of an existing branch
git branch --set-upstream-to=origin/main main
branch 'main' set up to track 'origin/main'.