-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
push: option to push to all remotes? #3578
Comments
@jorgeorpinel Not sure what is the scenario for this. Could you elaborate? |
If you have many remotes and want to push to all of them in a single command. |
For pull/fetch it could be to get the data from any remote where it exists, in case one or another remote has incomplete an cache backup. |
I don't understand why anyone would do that though. Am I missing some good scenario?
We've discussed it in another ticket, it would require some cascading logic for remotes to be able to retrieve whatever it can from whichever remote is available. |
I just wanted to recently when testing all kinds of GDrive URL types and formats (there's like 7 options haha). Not sure if there's an actual-use need for it but it's possible, say for a dataset registry repo that has a bunch of folders, each with it's own remote (for access permission purposes), but there's this one folder you want available in all remotes. It just increases the flexibility I think, but prob just a nice-to-have unless users actually request or imply the need for this. Up to you |
@jorgeorpinel Good points, but that is quite a synthetic testing scenario :)
Sounds like a subrepo use case. They will simply have theirown default remote. I would indeed wait for a user to ask for it, unless it is a blocker for you or significant improvement, of course. |
No, I agree with you. Thanks |
@efiop what do you think about renaming all-branches option |
@jorgeorpinel Not sure consistency there is worth so much trouble right now. Honestly, wouldn't bother right now with that. |
Wouldn't the option of making a backup of the files from the main remote by pushing them to the main and backup remote make sense? |
@dbokan2 Sure it makes sense for a backup, but it is out of scope for us right now and one could question if that kind of backup functionality is really in our focus (this seems more appropriate for a backup tool, which we are not really trying to be at this time). |
Just a note that git supports pushing to multiple URLs (as opposed to multiple remotes). These urls can be marked as 'push' URLs. git remote add origin https://[email protected]/myrepo
git remote set-url --push --add origin https://[email protected]/myrepo
git remote set-url --push --add origin https://[email protected]/myrepo
git push # <--- pushes to both URLs This results in a [core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = https://[email protected]/myrepo
fetch = +refs/heads/*:refs/remotes/origin/*
pushurl = https://[email protected]/myrepo
pushurl = https://[email protected]/myrepo This SO post has about 1000 upvotes, so I wouldn't exactly say this is an obscure feature. |
To save time and avoid human error, a new option like
dvc push --all|-A
could be created to push to all remotes. Not sure it would make sense to also consider for fetch and pull.Somewhat related to #2095
The text was updated successfully, but these errors were encountered: