How to push to multiple git remotes at once

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 (tusharhero@sdf.org)

tusharhero's pages is licensed under CC BY-ND 4.0

Date:

Site built at: 2024-05-31 Fri 04:57

Emacs 30.0.50 (Org mode 9.6.15)