push: can't upload single files to second remote without pushing data from other remotes as well
See original GitHub issueBug Report
push: can’t upload single files to second remote without pushing data from other remotes as well
Description
I’m working with multiple remotes within the same Git repository. To logically separate my data, I’m using the following config (without a set default remote):
['remote "campaigns"']
url = azure://my-campaigns/campaign-xy
account_name = <my-account-name>
exclude_environment_credential = True
exclude_visual_studio_code_credential = True
exclude_managed_identity_credential = True
exclude_shared_token_cache_credential = True
['remote "user-scores"']
url = azure://my-users/scores
account_name = <my-account-name>
exclude_environment_credential = True
exclude_visual_studio_code_credential = True
exclude_managed_identity_credential = True
exclude_shared_token_cache_credential = True
Assuming the following project structure:
|-- .dvc/
|-- data/
|---- raw/
|---- campaign.csv
|---- campaign.csv.dvc
|---- scores.csv
|---- scores.csv.dvc
My problem is, that every time I want to dvc push -r user-scores
, all files I previously pushed to the campaigns remote will also be uploaded to user-scores.
Reproduce
- dvc add data/raw/campaign.csv
- dvc push -r campaigns
- dvc add data/raw/scores.csv
- dvc push -r user-scores
Expected
The campaigns.csv
should not be uploaded to the user-scores remote.
Environment information
I’m working on Azure with dvc 2.26.2
.
Thanks for any help relating my issues.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Working with Git remotes and pushing to multiple Git ...
Working with two or more Git repositories? No problem! In this tutorial, you'll first learn to setup multiple Git remotes.
Read more >github - Git - Pushing code to two remotes
This one asks specifically how to push to multiple repos. While the other question mentions both pull and push, the accepted answer doesn't...
Read more >Push command successful but no changes reflected on ...
When you push a file to a remote git repository, it becomes part of the git repo there and you can't possibly download...
Read more >2.5 Git Basics - Working with Remotes
Collaborating with others involves managing these remote repositories and pushing and pulling data to and from them when you need to share work....
Read more >How to push new Git branches to remote repos on GitHub ...
Simply use a git push origin command on subsequent pushes of the new branch to the remote repo. New branch to remote Git...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@meierale I moved your question into a new feature request. Currently,
remote:
must be specified manually and not via the CLI flags, as you noted we would have to work out a way to remove any potential confusion between settingremote:
and passing a remote name to be used with--to-remote
.You can also use the
remote:
field in theouts
section of .dvc files to specify where a particular DVC-tracked file or directory should be pushed/pulled from. https://dvc.org/doc/user-guide/project-structure/dvc-files#output-entriesSo in your case you could add
remote: campaigns
incampaigns.csv.dvc
andremote: user-scores
inscores.csv.dvc
. You would then just rundvc push
/dvc pull
without using-r
to specify a remote and without needing to specify individual target files to push/pull.The one thing to note here would be that you will have to manually add the
remote:
field in all of your.dvc
files.