question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

push: can't upload single files to second remote without pushing data from other remotes as well

See original GitHub issue

Bug 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

  1. dvc add data/raw/campaign.csv
  2. dvc push -r campaigns
  3. dvc add data/raw/scores.csv
  4. 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:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pmrowlacommented, Sep 23, 2022

@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 setting remote: and passing a remote name to be used with --to-remote.

1reaction
pmrowlacommented, Sep 21, 2022

You can also use the remote: field in the outs 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-entries

So in your case you could add remote: campaigns in campaigns.csv.dvc and remote: user-scores in scores.csv.dvc. You would then just run dvc 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found