Git (Version Control) - Resolve "There is no tracking information for the current branch"

by
Jeremy Canfield |
Updated: February 29 2024
| Git (Version Control) articles
Let's say you issue the git pull command and "There is no tracking information for the current branch" is returned.
#]$ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> feature/foo
Often, this means you are not on the master branch, which can be seen with the git branch --all command.
]$ git branch --all
* feature/foo
feature/bar
master
remotes/origin/HEAD -> origin/master
remotes/origin/feature/foo
remotes/origin/feature/bar
Sometimes, using the git pull origin master command will be successful. But still, plain ole git pull may still return "There is no tracking information for the current branch".
~]$ git pull origin master
From ssh://git.example.com:7999/my/repo
* branch master -> FETCH_HEAD
Already up-to-date.
In this scenario, you'll probably want to issue the git branch command with the --set-upstream-to option.
~]$ git branch --set-upstream-to=origin/master feature/foo
Branch feature/foo set up to track remote branch master from origin.
And then, plain ole git pull may now work properly.
~]$ git pull
Already up-to-date.
Did you find this article helpful?
If so, consider buying me a coffee over at