Output '' is already tracked by SCM (e.g. Git)

I’m trying to add a .csv file to an s3 bucket.

poetry run dvc add <data file>
gives the following error
ERROR: output ‘filename’ is already tracked by SCM (e.g. Git)

The file doesn’t get added to the bucket.

Hi @saumya31,

This error means that <data file> is being tracked by Git. So it can’t also be tracked by DVC, unfortunately. You can use git rm --cached <data file> first if you want to go from Git to DVC tracking.

However, I’m not sure I understand your goal. What do you mean by “add it to an S3 bucket”? DVC can track it for you, and if you setup an S3 data remote and then dvc push, it’s contents will be stored there. But you won’t be able to find <data file> in the bucket with the same file name, DVC will cache it in a special structure (which you can see in .dvc/cache in your project without needing to push anything to a remote).