Track all remote git branches as local branches

前端 未结 15 2299
佛祖请我去吃肉
佛祖请我去吃肉 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:38

    for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do  git branch --track ${branch##*/} $branch; done
    

    Use this and you will not have such warning as: refname 'origin/dev' is ambiguous

提交回复
热议问题