git pull on a different branch

后端 未结 4 1631
耶瑟儿~
耶瑟儿~ 2021-02-01 01:37

If I\'m working on a branch and then realize I need to merge another branch into mine here is my current workflow (for this example lets say that I\'m working on my-branch and w

相关标签:
4条回答
  • 2021-02-01 02:07

    Try this:

    git pull yourRepositoryName master
    
    0 讨论(0)
  • 2021-02-01 02:12

    I found an incantation that worked for me:

    git fetch origin master:master
    

    then (if you want to merge right away):

    git merge master
    

    I was really surprised how hard it was to find an answer to this since it seems like it would be a common use case.

    0 讨论(0)
  • 2021-02-01 02:24

    You could also try this:

    git fetch
    git merge origin/master
    

    This won't update your local master pointer, but it will merge the latest origin/master into your current local branch.

    0 讨论(0)
  • 2021-02-01 02:26

    How'bout this :

    $ git pull origin my-branch
    
    0 讨论(0)
提交回复
热议问题