Track all remote git branches as local branches

前端 未结 15 2183
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-22 09:01

Tracking a single remote branch as a local branch is straightforward enough.

$ git checkout --track -b ${branch_name} origin/${branch_name}
<
15条回答
  •  逝去的感伤
    2020-11-22 09:31

    If you want to use powershell and your remote is called origin. Then this works.

    git fetch    
    git branch -r  | %{$_ -replace "  origin/"} | %{git branch --track $_ "origin/$_"}
    

提交回复
热议问题