You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for multiple push URLs in Git repositories
Enables pushing to multiple remotes (e.g., GitHub + GitLab mirrors)
by configuring multiple push URLs using multiline syntax, consistent
with version-overrides and ignores patterns.
Implementation:
- config.py: Add parse_multiline_list() to parse multiline pushurl values
- config.py: Detect and store multiple pushurls as list with backward compat
- vcs/git.py: Update git_set_pushurl() to use --add flag for additional URLs
- First pushurl set without --add, subsequent ones with --add
Configuration example:
```ini
[my-package]
url = https://github.com/org/repo.git
pushurl =
git@github.com:org/repo.git
git@gitlab.com:org/repo.git
git@bitbucket.org:org/repo.git
```
Backward compatibility:
- Single pushurl: Works unchanged (no pushurls list created)
- Multiple pushurls: New multiline syntax (pushurls list created)
- First pushurl stored in pushurl key for backward compat
- Smart threading logic unchanged (checks for pushurl presence)
Tests:
- test_config_parse_multiple_pushurls: Config parsing validation
- test_git_set_pushurl_multiple: Git command sequence verification
- test_git_checkout_with_multiple_pushurls: End-to-end integration
All 197 tests pass (194 existing + 3 new).
All linting checks pass.
Documentation updated in README.md and CHANGES.md.
Copy file name to clipboardExpand all lines: CHANGES.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
## 5.0.2 (2025-10-23)
4
4
5
+
- Feature: Git repositories can now specify multiple push URLs using multiline syntax in the `pushurl` configuration option. This enables pushing to multiple remotes (e.g., GitHub + GitLab mirrors) automatically. Syntax follows the same multiline pattern as `version-overrides` and `ignores`. Example: `pushurl =` followed by indented URLs on separate lines. When `git push` is run in the checked-out repository, it will push to all configured pushurls sequentially, mirroring Git's native multi-pushurl behavior. Backward compatible with single pushurl strings.
6
+
[jensens]
5
7
- Fix #70: HTTP-referenced requirements/constraints files are now properly cached and respected in offline mode. Previously, offline mode only skipped VCS operations but still fetched HTTP URLs. Now mxdev caches all HTTP content in `.mxdev_cache/` during online mode and reuses it during offline mode, enabling true offline operation. This fixes the inconsistent behavior where `-o/--offline` didn't prevent all network activity.
6
8
[jensens]
7
9
- Improvement: Enhanced help text for `-n/--no-fetch`, `-f/--fetch-only`, and `-o/--offline` command-line options to better explain their differences and when to use each one.
|`pushurl`| optional | Writable URL for pushes (not applied after initial checkout)| — |
242
+
|`pushurl`| optional | Writable URL(s) for pushes. Supports single URL or multiline list for pushing to multiple remotes. Not applied after initial checkout.| — |
243
243
244
244
**VCS Support Status:**
245
245
-`git` (stable, tested)
@@ -266,6 +266,23 @@ For package sources, the section name is the package name: `[PACKAGENAME]`
266
266
-**`checkout`**: Submodules only fetched during checkout, existing submodules stay untouched
267
267
-**`recursive`**: Fetches submodules recursively, results in `git clone --recurse-submodules` on checkout and `submodule update --init --recursive` on update
268
268
269
+
##### Multiple Push URLs
270
+
271
+
You can configure a package to push to multiple remotes (e.g., mirroring to GitHub and GitLab):
272
+
273
+
```ini
274
+
[my-package]
275
+
url = https://github.com/org/repo.git
276
+
pushurl =
277
+
git@github.com:org/repo.git
278
+
git@gitlab.com:org/repo.git
279
+
git@bitbucket.org:org/repo.git
280
+
```
281
+
282
+
When you run `git push` in the checked-out repository, Git will push to all configured pushurls sequentially.
283
+
284
+
**Note:** Multiple pushurls only work with the `git` VCS type. This mirrors Git's native behavior where a remote can have multiple push URLs.
285
+
269
286
### Usage
270
287
271
288
Run `mxdev` (for more options run `mxdev --help`).
0 commit comments