DEV Community

Discussion on: 15 Git Commands You May Not Know

Collapse
 
gergelypolonkai profile image
Gergely Polonkai

checkout - caught me unaware last time i used my rebase-all script, as it also works with merge and rebase (and actually anywhere you need to pass a commitish to a Git command). This script of mine walks all local branches and rebases them onto the branch i specify on the command line (or origin/master if i don’t). Also, if i pass -n as the first parameter, it doesnʼt do a git fetch before traversing my branches. Now few days ago i invoked it as git rebase-all -.

My following workday wasnʼt funny. Context: i usually have 40ish local branches.