[RFC PATCH v5 0/3] push: add support for pushing to remote groups
- From
Usman Akinyemi <usmanakinyemi202@gmail.com>
- Date
- May 3, 2026, 15:33 UTC
- Message-ID
- <20260503153402.1333220-1-usmanakinyemi202@gmail.com>
- In-Reply-To
- <20260427140530.856125-1-usmanakinyemi202@gmail.com>
This RFC series adds support for `git push` to accept a remote group name (as configured via `remotes.<name>` in config) in addition to a single remote name, mirroring the behaviour that `git fetch` has supported for some time.
A user with multiple remotes configured as a group can now do:
git push all-remotes
instead of pushing to each remote individually, in the same way that:
git fetch all-remotes
already works.
The series is split into two patches:
- Patch 1 moves `get_remote_group`, `add_remote_or_group`, and the
`remote_group_data` struct out of builtin/fetch.c and into
remote.c/remote.h, making them part of the public remote API. - Patch 2 extends builtin/push.c to use the newly public
`add_remote_or_group()` to resolve the repository argument as
either a single remote or a group, and pushes to each member of
the group in turn.Changes in v5: - fixed the -Werror=sign-compare in builtin/push.c complaints and also added a new commit that fix the remote.h
Range-diff v4 -> v5:
-: ---------- > 1: e01126890c remote: fix sign-compare warnings in push_cas_option
1: 20ed79546f = 2: adbce652e6 remote: move remote group resolution to remote.c
2: 964694e587 ! 3: a8d5f4b7bd push: support pushing to a remote group
@@ builtin/push.c: static int git_push_config(const char *k, const char *v,
+ const char **refspecs,
+ int refspec_nr)
+{
-+ int i, result = 0;
++ int result = 0;
++ size_t i;
+ struct strvec argv = STRVEC_INIT;
+
+ strvec_push(&argv, "push");Usman Akinyemi (3): remote: fix sign-compare warnings in push_cas_option remote: move remote group resolution to remote.c push: support pushing to a remote group
Documentation/git-push.adoc | 80 ++++++++++-- builtin/fetch.c | 42 ------ builtin/push.c | 251 +++++++++++++++++++++++++++++++----- remote.c | 37 ++++++ remote.h | 16 ++- t/meson.build | 1 + t/t5566-push-group.sh | 160 +++++++++++++++++++++++ 7 files changed, 502 insertions(+), 85 deletions(-) create mode 100755 t/t5566-push-group.sh
-- 2.53.0