I use the sync subcommand of hub to automate this.

hub sync

This updates all local branches that have a matching upstream branch. From the man page:

  • If the local branch is outdated, fast-forward it;
  • If the local branch contains unpushed work, warn about it;
  • If the branch seems merged and its upstream branch was deleted, delete it.

It also handles stashing/unstashing uncommitted changes on the current branch.

I used to use a similar tool called git-up, but it's no longer maintained, and git sync does almost exactly the same thing.

Answer from John on Stack Overflow
🌐
Git
git-scm.com β€Ί docs β€Ί git-pull
Git - git-pull Documentation
First, git pull runs git fetch with the same arguments (excluding merge options) to fetch remote branch(es). Then it decides which remote branch to integrate: if you run git pull with no arguments this defaults to the upstream for the current branch.
🌐
Atlassian
atlassian.com β€Ί git β€Ί tutorials β€Ί syncing β€Ί git pull
How to Pull a Git Repository? | Atlassian Git Tutorial
The git pull command first runs git fetch which downloads content from the specified remote repository. Then a git merge is executed to merge the remote content refs and heads into a new local merge commit. To better demonstrate the pull and merging process let us consider the following example.
🌐
PhoenixNAP
phoenixnap.com β€Ί home β€Ί kb β€Ί devops and development β€Ί how to pull all branches in git
How to Pull All Branches in Git
December 19, 2025 - Follow the steps below to pull all remote branches: 1. Open a Git bash window and change the location to your local repository. 2. Run the following command to ensure Git starts tracking all the remote branches, including the ones that don't exist in your local copy:
🌐
GeeksforGeeks
geeksforgeeks.org β€Ί git β€Ί how-to-pull-all-branches-in-git
How To Pull All Branches In Git? - GeeksforGeeks
September 24, 2024 - In Git, pulling all branches is the process of fetching the latest changes from a remote repository and merging them into the local branches.
🌐
GitHub
gist.github.com β€Ί grimzy β€Ί a1d3aae40412634df29cf86bb74a6f72
Git pull all remote branches Β· GitHub
I think git is still being developed. Its like another programming language on its own. I'd like all GUI usage with drag and drop in the future ... Hi, According to the doc on pull, the --all option only affects the fetch part of the pull command. So isn't it kind of useless to do a fetch --all before a pull --all ?
🌐
Career Karma
careerkarma.com β€Ί blog β€Ί git β€Ί git: pull all branches
Git: Pull All Branches | Career Karma
December 1, 2023 - On Career Karma, learn how to use the git fetch --all and git pull --all commands to pull all branches from a Git repository.
Find elsewhere
🌐
Medium
madalinaeleonorag.medium.com β€Ί git-fetch-pull-for-all-repos-once-82a0abff828b
Git fetch & pull for all repos once | by Gheorghe Madalina Eleonora | Medium
April 6, 2021 - for i in */.git; do ( echo β€œπŸ“‚β€ $i; cd $i/..; echo β€œπŸ”„ Fetching”; git fetch --all; echo β€œπŸ”½ Pulling”; git pull; echo β€˜β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€˜); done
🌐
GitHub
github.com β€Ί git-guides β€Ί git-pull
Git Guides - git pull Β· GitHub
You can update your local working branch with commits from the remote, but rewrite history so any local commits occur after all new commits coming from the remote, avoiding a merge commit. This is done with git pull --rebase.
🌐
Frontend Masters
frontendmasters.com β€Ί courses β€Ί everything-git β€Ί pull
Pull - Everything You'll Need to Know About Git | Frontend Masters
ThePrimeagen explains how to use the "git pull" command to fetch and merge changes from a remote branch into your local branch. He discusses the importance of setting tracking information for branches …
🌐
Linux Hint
linuxhint.com β€Ί pull-all-branches-in-git
How to Pull All Branches in Git – Linux Hint
To pull all branches in Git, move to Git directory, clone remote repo, fetch all metadata of branches, and execute the β€œ$ git pull -- all” command.
🌐
W3Schools
w3schools.com β€Ί git β€Ί git_pull_from_remote.asp
Git Pull from Remote
There! Your local git is up to date! But what if you just want to update your local repository, without going through all those steps? ... It is used to pull all changes from a remote repository into the branch you are working on.
🌐
Git Tower
git-tower.com β€Ί learn β€Ί git faq β€Ί how to use git pull in git (with examples)
How to Use git pull in Git (with Examples) | Learn Version Control with Git
5 days ago - The git pull command downloads the code that is available from a remote repository (such as GitHub, GitLab, BitBucket, or another code hosting platform) and automatically merges any changes.
🌐
freeCodeCamp
freecodecamp.org β€Ί news β€Ί git-pull-explained
Git Pull Explained
January 27, 2020 - git pull is a Git command used to update the local version of a repository from a remote. It is one of the four commands that prompts network interaction by Git. By default, git pull does two things. Updates the current local working branch (current...
🌐
Medium
pavolkutaj.medium.com β€Ί can-you-update-all-git-branches-at-once-755b6eb2129
Can You Update All Git Branches At Once | by Pavol Z. Kutaj | Medium
May 6, 2021 - git fetch --all git rebase origin/master git checkout staging git rebase origin/staging git checkout production git rebase origin/production ... it seems to do a fetch --all β†’ then updates (fast forward or merges) the current working branch β€” but not the other local branches Β· i.e. you still have to manually switch to each local branch and update Β· this behavior of pull --all is exactly as expected (though not necessarily always useful)
🌐
DataCamp
datacamp.com β€Ί tutorial β€Ί git-pull
Git Pull: Keeping Your Local Repository Up to Date | DataCamp
March 10, 2025 - What’s cool about git pull is that it combines two steps: first, it performs a git fetch to download the latest changes, and then it automatically runs a git merge to integrate those updates into your branch.
🌐
Git Scripts
gitscripts.com β€Ί git-pull-all-branches
Git Pull All Branches: A Quick Guide for Developers
January 26, 2024 - To pull all branches, you can start with the `git fetch` command, which retrieves all changes from the remote repository without merging them immediately. This allows you to see what’s new in all branches.
🌐
Linux Kernel
kernel.org β€Ί pub β€Ί software β€Ί scm β€Ί git β€Ί docs β€Ί git-pull.html
git-pull(1) Manual Page
December 14, 2025 - It discards everything the other tree did, declaring our history contains all that happened in it. ... This is the opposite of ours; note that, unlike ours, there is no theirs merge strategy to confuse this merge option with. ... Treats lines with the indicated type of whitespace change as unchanged for the sake of a three-way merge. Whitespace changes mixed with other changes to a line are not ignored. See also git...