use git index to see force-added files
See original GitHub issueWe’ve received a few reports about people getting confused by dvc pull/etc not detecting their dvc files in configuration with such .gitignore:
/data
!**/*.dvc
as explained by @pmrowla , this is just a nonobvious git behavior and a workaround is:
/data/**
!/data/**/
!/data/**/*.dvc
But dvc list will see those files no problem, because it doesn’t seem to use is_ignore (needs confimation), thus, we should use git index locally as well to detect force-added files even if they are gitignored.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:14 (4 by maintainers)
Top Results From Across the Web
Git - git-show-index Documentation
The objects are output in the order in which they are found in the index file, which should be (in a correctly constructed...
Read more >Understanding Git — Index
Instead, git has a file called the index that it uses to keep track of the file changes over the three areas: working...
Read more >What does the git index contain EXACTLY?
The index is a binary file (generally kept in .git/index ) containing a sorted list of path names, each with permissions and the...
Read more >MergeConflictHandler must use `git add -f` to ignore .gitignore
Defines whether conflicted files should be added to the index using git add --force, during automatic merges. By # default, this behaviour is...
Read more >The Git index and Recovering Files
When I git add a file, it will add that file to the object database ... my staging area using the git ls-files...
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 Free
Top 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

I think this is enough.
@SebbanSms
depsonly declare dependencies for that particular stage, they don’t really do data management. Plus, same path could be declared as a dependency in multiple stages/dvc.yaml’s , which is a bit problematic for us right now in terms of mapping of versions (aka md5s), while outs are unique and don’t have that problem. We might reconsider this in the future though.