What is an upstream branch in Git?
An upstream branch is the remote branch that your local branch is linked to. With it set, plain git pull, git push and git status know where to send and compare changes without extra arguments.
Explain it simply
A local branch with an upstream is like a phone contact with a saved number. You say 'call' and it knows whom.
When you clone, main already tracks origin/main. For a new branch you set the link on first push: git push -u origin feature/x. After that, git status says 'ahead by 2' or 'behind by 1', and git pull and git push work without arguments. See the mapping with git branch -vv. Change it with git branch --set-upstream-to=origin/other.
Example
git switch -c feature/search
git push -u origin feature/search # -u sets upstream
git branch -vv
# * feature/search 3a4b5c6 [origin/feature/search] Add search boxWhat to say in the interview
"The upstream is the remote branch a local branch tracks. I set it with git push -u origin branch. Afterwards git pull, git push and git status work without arguments, and status shows how many commits I am ahead or behind."