Fetch branches from multiple remotes

Git lets you refer to mul­ti­ple remotes from your local. This strat­egy helps you refer to dif­fer­ent forks of the same repos­i­tory. How­ever, this also means that time and again you will need to fetch data from all of those remotes to keep your local in sync with them. The eas­i­est way to do that is by running.

git remote update
git remote update --prune

The above com­mands will fetch the changes from all of your remotes, update your remote track­ing branches and also remove any obso­lete branches.


Ryan Sukale

Ryan is a UX engineer living in San Francisco, California.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *