Git “There Is No Tracking Information for the Current Branch”: How to Fix It

You run git pull and Git answers with “There is no tracking information for the current branch.” It’s one of the most common Git messages, and it doesn’t mean anything is broken. Your local branch simply isn’t linked to a branch on the remote, so Git doesn’t know where to pull from. This guide explains what tracking branches are, how to fix the message in one command, and how to stop it from happening with new branches.

Quick answer

Link your branch to its remote counterpart with:

git branch --set-upstream-to=origin/main main

Replace main with your branch name. If the branch doesn’t exist on the remote yet, push it with git push -u origin your-branch instead, which creates it and sets up tracking at the same time.

What “tracking information” means

A tracking branch (also called an upstream branch) is the remote branch your local branch is connected to. When a branch has an upstream, you can type plain git pull or git push and Git knows which remote and which branch to use. It also lets git status tell you when you’re ahead of or behind the remote.

Branches you create locally with git branch or git checkout -b don’t get an upstream automatically. Branches you get by cloning, or by checking out a branch that already exists on the remote, usually do.

Step 1: Check which branches are tracking

Run this to see every local branch and its upstream:

git branch -vv

Branches with tracking show the remote branch in square brackets, such as [origin/main]. The branch giving you the error won’t have one.

Also confirm the name of your remote, which is usually origin:

git remote -v

Step 2: Set the upstream for an existing remote branch

If the branch already exists on the remote, connect the two:

git branch --set-upstream-to=origin/feature-login feature-login

If you’re already on that branch, you can use the shorter form:

git branch -u origin/feature-login

Now plain git pull and git push work without extra arguments.

Step 3: Push a new branch and set tracking at once

If the branch only exists on your computer, there’s nothing on the remote to track yet. Push it with the -u flag:

git push -u origin feature-login

The -u (short for –set-upstream) creates the branch on the remote and links your local branch to it. You only need it the first time.

Option: Pull once without setting tracking

If you just need to pull this one time, name the remote and branch directly:

git pull origin main

This works but doesn’t fix the underlying issue, so you’ll see the message again the next time you run plain git pull.

Prevent the error for future branches

Git 2.37 and later can set up tracking automatically the first time you push a new branch:

git config --global push.autoSetupRemote true

After that, a plain git push on a new branch creates it on the remote with tracking, no -u needed. Check your version with git --version. If you’re on Windows and need a newer version, see how to install Git on Windows 11.

You can also have Git track remote branches automatically when you create a local branch from one:

git checkout -b feature-login origin/feature-login

Or simply run git switch feature-login. If a remote branch with that name exists and there’s no local branch yet, Git creates the local branch and sets up tracking for you.

If the remote branch can’t be found

If --set-upstream-to says the remote branch doesn’t exist, your local list of remote branches may be out of date. Fetch first:

git fetch origin

Then check what’s on the remote with git branch -r. Look for differences in spelling or capitalization. Branch names are case-sensitive on most remotes, so Feature-Login and feature-login are different branches. If the branch was deleted on the remote, push your local copy again with git push -u.

Remove or change tracking

To point a branch at a different upstream, run --set-upstream-to again with the new remote branch. To remove tracking entirely, use:

git branch --unset-upstream

That’s useful after a remote branch is deleted, when git status keeps reporting that the upstream is gone.

Related: How to resolve Git exit code 128 errors.

Frequently asked questions

Is this message an error?

Not really. It’s Git telling you it needs more information. No data has been lost, and nothing has been changed.

What’s the difference between origin and upstream?

origin is the default name for the remote repository you cloned from. An upstream branch is the specific remote branch, like origin/main, that a local branch tracks. In forked projects, people often add a second remote named upstream for the original repository, which is a separate meaning.

Does setting tracking change my code?

No. It only stores a link in your repository’s configuration. Your files and commits stay the same until you pull or push.