I'm trying to include all (data) files in LFS except if they have the .(r|R) or .(cpp|CPP) extension, but somehow both extensions end up in LFS too, and I'm unable the remove them from it. This is what I tried so far:
/**/data/** filter=lfs diff=lfs merge=lfs -text
/**/data/**.[rR] -filter=lfs -diff=lfs -merge=lfs text
/**/data/**.[cC][pP][pP] -filter=lfs -diff=lfs -merge=lfs text
and
/**/data/** filter=lfs diff=lfs merge=lfs -text
/**/data/**.[rR] !filter !diff !merge text
/**/data/**.[cC][pP][pP] !filter !diff !merge text
After that I do:
find user-*/data -name "*.R" -print0 | xargs -0 -i echo git lfs untrack "'{}'" | bash
find user-*/data -name "*.R" -print0 | xargs -0 -i echo git rm --cached "'{}'" | bash
find user-*/data -name "*.R" -print0 | xargs -0 -i echo git add "'{}'" | bash
What am I doing wrong?
git check-attr -a for one of the files I like to exclude from LFS looks like this:
# git check-attr -a 'user-004/data/get-data.R'
user-004/data/get-data.R: diff: unset
user-004/data/get-data.R: merge: unset
user-004/data/get-data.R: text: set
user-004/data/get-data.R: filter: unset
If I understand it correctly that's good, but the file still is in LFS and I don't know how to move it to regular versioning.
git check-attrto check attributes.find . | xargs git check-attr -agit lfs fetch+git lfs checkout? Or explicitly usegit lfs smudge:git lfs smudge < user-004/data/get-data.R > tmp && mv tmp user-004/data/get-data.R