After git pull I get this output.
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> my_branch
Problem is that I have created that branch and have done tones of commits on this branch and switching to other branches and getting back to this one. Than a new user added few commits and after that I am getting this message.
My question is not how to fix this I want to know what cause this and how to prevent it from happening again.
This is because you didn't set the upstream
(which means which remote branch you want to track).
To set the tracking remote branch:
If the local branch is created in your local machine, then when you push to the remote, you could use -u
/--set-upstream
option when you do git push
.
If the branch is checked out from a remote branch, then you could use --track
option when you do git checkout
.
To fix this(set a remote tracking branch), just do what git tell you:
git branch --set-upstream-to=origin/<branch> my_branch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With