Skip to content
masterclass Buddy

Git · Concept

Upstream branch

An upstream branch links a local branch to a remote-tracking branch. Git uses it as the default for several remote operations, including push, pull, and fetch without arguments.

Last updated

Syntax

git push --set-upstream <remote> <branch>

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • git push
  • git pull
  • git fetch
  • push.default
  • branch.<name>.pushRemote
  • push.autoSetupRemote

Source: Git - git-push Documentation. Checked 2026-11-03.