git checkout tag, git pull fails in branch

后端 未结 14 576
渐次进展
渐次进展 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:26

    You might have multiple branch. And your current branch didn't set its upstream in remote.

    Steps to fix this:

    git checkout branch_name
    git branch --set-upstream-to=origin/remote_branch_name local_branch_name
    

    e.g.

    // this set upstream of local branch develop to remote branch  origin/develop,
    git branch --set-upstream-to=origin/develop develop
    

    After doing this, when you do git pull, it pull from specified branch.

提交回复
热议问题