git checkout tag, git pull fails in branch

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

    @alesko : it is not possible to only do only git pull after checkout my_branch to update master branch only.
    Because git pull will also merge to the current branch -> in your scenario to the my_branch

    @Simon: that will do also the push. why is that?

    $ git branch -u origin/master
    Branch master set up to track remote branch master from origin.
    

    and acording to docs:

    -u 
      Set up 's tracking information so  is considered  
      's upstream branch. If no  is specified,  
      then it defaults to the current branch.
    

提交回复
热议问题