Can “git pull --all” update all my local branches?

前端 未结 25 2391
失恋的感觉
失恋的感觉 2020-11-22 16:33

I often have at least 3 remote branches: master, staging and production. I have 3 local branches that track those remote branches.

Updating all my local branches is

25条回答
  •  自闭症患者
    2020-11-22 17:36

    Can “git pull --all” update all my local branches?

    No it cannot. For fast-forwarding, I just wrote a small tool to do so. https://github.com/changyuheng/git-fast-forward-all

    Advantages of this tool:

    1. Supports multiple remotes in one repository. (hub sync doesn't support multiple remotes at the moment.)
    2. Supports having different names on the local branch and the corresponding remote tracking branche.
    3. Much faster than other scripts that fetches remote for every single branch.
    4. No error-prone regex parsing/editing.

提交回复
热议问题