Twitterでそういった処理についてできるかどうかというのを見かけたので、実際どうなんだろと思って調べてみた。 結論としては、残念ながらgit単体では難しいみたいで、実現するにしても以下のように無理やりシェル芸で実現するとかになるようだ。

git clone git@github.com:blacknon/lssh.git && cd $(basename $_ .git) && git branch -r | grep -v '\->' | sed 's|origin/||g' | xargs -I@ -n1 git checkout -b @ origin/@

blacknon@BS-PUB-DEVELOP:~$ git clone git@github.com:blacknon/lssh.git && cd $(basename $_ .git) && git branch -r | grep -v '\->' | sed 's|origin/||g' | xargs -I@ -n1 git checkout -b @ origin/@
Cloning into 'lssh'...
remote: Counting objects: 730, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 730 (delta 4), reused 13 (delta 3), pack-reused 714
Receiving objects: 100% (730/730), 7.97 MiB | 1.90 MiB/s, done.
Resolving deltas: 100% (375/375), done.
Checking connectivity... done.
Branch 20171208_try_pexcpct_with_winch set up to track remote branch 20171208_try_pexcpct_with_winch from origin.
Switched to a new branch '20171208_try_pexcpct_with_winch'
Branch develop set up to track remote branch develop from origin.
Switched to a new branch 'develop'
fatal: A branch named 'master' already exists.
blacknon@BS-PUB-DEVELOP:~/lssh$
blacknon@BS-PUB-DEVELOP:~/lssh$ git branch
  20171208_try_pexcpct_with_winch
* develop
  master

一応できなくは無いけど、さすがにこれをそらで打てるかと言われると… せいぜいエイリアスに書いておくくらいだろうか?