how can I do a get latest on a remote branch?

This question already has an answer here:

  • How do I check out a remote Git branch? 21 answers

  • You don't fetch a branch, you fetch a remote, so the correct line would be

    git fetch origin # or whatever your upstream is called
    

    Then the all tracking branches are updated, your updated code will be it a branch called origin/myDevBranch , again origin is replaced with your upstream name

    To update your local branch you can merge the upstream git merge origin/myDevBranch or you can checkout to it git checkout origin/myDevBranch but that would leave you in a detached head mode, you can create a new local branch from that remote using git checkout -b

    链接地址: http://www.djcxy.com/p/3822.html

    上一篇: 我怎样才能第一次拉远程目录?

    下一篇: 我该如何做一个最新的远程分支?