I work with multiple branches, but I'm only modifying one of them (I'll call it working
). I'd like to be able to get the latest for working
but also get the latest for all of my tracking branches. Since the other tracking branches are rarely modified, they can usually fast forward.
I'd hoped git-pull could do it, but this doesn't achieve my desired result:
git checkout working
git pull --ff-only --all
My local main
branch wasn't modified: it is still behind the remote branch mine/main
.
I can force the update to main:
git br -f main mine/main
But I'd rather something automatic and something safer so it only modifies the branch if it can be safely fast forwarded. However, I don't actually want to check out the branch since I'm not actively working on it and don't intend to merge.
There are a bunch of scripts on Can "git pull --all" update all my local branches?, but this question is about a solution built into git.
Related but unhelpful: Does a git pull update all tracked branches?