Wednesday, September 6, 2023

Single command to checkout all branches in git

 Single command to checkout all branches in git


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


This is useful when we do git migrations.

No comments:

Post a Comment