There is no tracking information for the current branch

后端 未结 13 2565
无人及你
无人及你 2020-11-27 23:59

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

相关标签:
13条回答
  • 2020-11-28 00:28

    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".

    0 讨论(0)
  • 2020-11-28 00:31

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

    0 讨论(0)
  • 2020-11-28 00:36

    $ git branch --set-upstream-to=heroku/master master and

    $ git pull
    

    worked for me!

    0 讨论(0)
  • 2020-11-28 00:37

    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
    
    0 讨论(0)
  • 2020-11-28 00:38

    1) git branch --set-upstream-to=origin/<master_branch> feature/<your_current_branch>

    2) git pull

    0 讨论(0)
  • 2020-11-28 00:41

    This happens due to current branch has no tracking on the branch on the remote. so you can do it with 2 ways.

    1. Pull with specific branch name

    git pull origin master

    1. Or you can specific branch to track to the local branch.

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

    0 讨论(0)
提交回复
热议问题