git checkout tag, git pull fails in branch

后端 未结 14 591
渐次进展
渐次进展 2021-01-29 22:51

I have cloned a git repository and then checked out a tag:

# git checkout 2.4.33 -b my_branch

This is OK, but when I try to run git pull<

14条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-29 23:12

    I had the same problem and fixed it with this command:

    $ git push -u origin master
    

    From the help file the -u basically sets the default for pulls:

    -u, --set-upstream`
    
      For every branch that is up to date or successfully pushed, add 
      upstream (tracking) reference, used by argument-less git-pull(1) and
      other commands. For more information, see branch..merge in 
      git-config(1).
    

提交回复
热议问题