I often have at least 3 remote branches: master, staging and production. I have 3 local branches that track those remote branches.
Updating all my local branches is
The behavior you describe for pull --all
is exactly as expected, though not necessarily useful. The option is passed along to git fetch, which then fetches all refs from all remotes, instead of just the needed one; pull
then merges (or in your case, rebases) the appropriate single branch.
If you want to check out other branches, you're going to have to check them out. And yes, merging (and rebasing) absolutely require a work tree, so they cannot be done without checking out the other branches. You could wrap up your described steps into a script/alias if you like, though I'd suggest joining the commands with &&
so that should one of them fail, it won't try to plow on.