How to push to multiple git remotes at once

~277 words. ~1 minutes.

tags: git programming tutorial

If you use multiple git remotes like me, you often have to manually push to each remote one by one. I have good news, you don't have to do it manually! Here is how you can push to all your remotes at once.

add this to your .git/config

[remote "allremotes"]
        fetch = +refs/heads/*:refs/remotes/allremotes/*
        url = ... (url of first remote)
        url = ... (url of second remote)
        ...

You just add as many urls are you want! To push to it just run, git push allremotes.

Author: tusharhero

emailreplace [at] with @, and put the domain for username, and vice versa: sdf.org [at] tusharhero

© tusharhero 2024-2025, check licenses page for details.

Date:

Site built at: 2025-03-10 Mon 05:40

Emacs 31.0.50 (Org mode 9.7.11)