git branch --set-upstream-to <remote-branch>
// example
git branch --set-upstream-to origin feature-branch
// show up which remote branch a local branch is tracking
git branch -vv
// short version to set upstream with very first push
git push -u origin local-branch
git remote -v
git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
git remote -v
$ git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
$ git push -u <remote> <branch>
# to connect a remote branch with your local one you
# can use branch command with the --set-upstream-to flag
# connecting origin/main to local main
git branch --set-upstream-to origin/main main
# same command shorter version
git branch -u origin/main main
# same command shorter - without branch name (defaults to current)
git branch -u origin/main
GIT BRANCH UPSTREAM