git checkout tag, git pull fails in branch

后端 未结 14 565
渐次进展
渐次进展 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条回答
  •  隐瞒了意图╮
    2021-01-29 23:14

    If like me you need to do this all the time, you can set up an alias to do it automatically by adding the following to your .gitconfig file:

    [alias]
        set-upstream = !git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD`
    

    When you see the message There is no tracking information..., just run git set-upstream, then git push again.

    Thanks to https://zarino.co.uk/post/git-set-upstream/

提交回复
热议问题