I\'ve been using github from a relatively short period, and I\'ve always used the client to perform commits and pulls. I decided to try it from the git bash yesterday, and I
With Git 2.24, you won't have to do
git branch --set-upstream-to=origin/master master
git pull
You will be able to do:
git pull --set-upstream-to=origin/master master
See more at "default remote and branch using -u option - works with push but not pull".
git branch --set-upstream-to=origin/main
$ git branch --set-upstream-to=heroku/master master
and
$ git pull
worked for me!
ComputerDruid's answer is great but I don't think it's necessary to set upstream manually unless you want to. I'm adding this answer because people might think that that's a necessary step.
This error will be gone if you specify the remote that you want to pull like below:
git pull origin master
Note that origin
is the name of the remote and master
is the branch name.
1) How to check remote's name
git remote -v
2) How to see what branches available in the repository.
git branch -r
1) git branch --set-upstream-to=origin/<master_branch>
feature/<your_current_branch>
2) git pull
This happens due to current branch has no tracking on the branch on the remote. so you can do it with 2 ways.
git pull origin master
git branch --set-upstream-to=origin/