. Advertisement .
..3..
. Advertisement .
..4..
I don’t know what I’m doing wrong, but I’ve already lost a couple of days struggling with this. Here is my command line:
$ git status
# On branch master
nothing to commit, working directory clean
$ git branch
* master
This returns:
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 develop origin/<branch>
I don’t have any experience with the “there is no tracking information for the current branch..”. In this case, how should I change?
The cause:
When Git pull is running, changes from the remote copy of the branch will be pulled into the local branch by Git. And this error happens because Git doesn’t know to pull from which branch on the server.
Solution:
You can specify which branch you wish to pull:
You could also set it up so your local master branch tracks the github master branch upstream.
The branch tracking is automatically set up when you clone the repository. However, if you want to add a remote to an already existing repository, you will need to do this yourself. It is easy to follow the git advice.
See git checkout tags, git pull failures in branch.
You can create an alias if you are like me and need to do this constantly by adding the following
.gitconfig
file to it:Run when you see the
There is no tracking information...
message.Thanks to https://zarino.co.uk/post/git-set-upstream/