Skip to content
GitTree
Branches and tags

Set tracking and publish a branch

A new branch exists only on your computer until you push it. The first Push asks which remote to send it to, and from then on the branch tracks that remote branch (its upstream), like git push -u. Set Upstream… changes what it tracks.

FreeUpdated

Works in GitTree Free: every local Git feature, once you are signed in.

On this page
  1. Before you start
  2. Where to find it
  3. Steps
  4. Expected result
  5. Change what a branch tracks
  6. If something goes wrong
  7. Questions
  8. Related

Before you start

Where to find it

  • Push in the toolbar, on a branch that tracks nothing yet.
  • Right-click a branch: Upstream › Set Upstream…, Unset Upstream or Fast-Forward to Upstream.
ActionmacOSWindows and Linux
Push⌘⇧UCtrl+Shift+U

Steps

  1. Push the new branch

    With the branch checked out, press Push. GitTree says the branch does not track a remote branch yet and asks for the Remote.

  2. Choose the remote

    Pick the remote, usually origin, and press Push to origin. The branch is created there with the same name.

  3. Check the labels

    The branch label now shows both icons: your local branch and the remote one are level.

    The GitTree graph with a branch label showing it is on the computer and on origin
    A label with both icons is a local branch level with its upstream.GitTree interface with a demonstration repository.

Expected result

The branch is on the remote and tracks it: Pull and Push now work with it without asking.

Change what a branch tracks

  • Set Upstream… opens What should … track?: pick the Upstream branch and press Track, or Track Nothing.
  • Fast-Forward to Upstream moves the branch to its upstream when it has nothing new of its own.
  • To push to a branch with another name, run Push … to … from the command palette.

If something goes wrong

“There are no remote-tracking branches yet. Fetch first.”

GitTree only knows the remote’s branches after a fetch. Choose Fetch All, then set the upstream.

“This branch does not track anything.”

Actions such as Fast-Forward to Upstream need an upstream. Push the branch, or use Set Upstream….

Questions

What is an upstream branch?

The remote branch your local branch follows, such as origin/feature/search. GitTree compares the two to show what you need to pull or push.