Even if the question is about files that were not committed, let me suggest a solution for the list of files tracked by git, but not git-lfs after commit , which you can do by concatenating the list of files tracked by git ( git ls-files ) with those that are tracked by git-lfs ( git lfs ls-files | cut -d' ' -f3- ) and then only take files that are unique in this list:
{ git ls-files && git lfs ls-files | cut -d' ' -f3-; } | sort | uniq -u
After that, you can edit the commit ( git rm --cached and git commit --amend ) if you notice a file that sneaked into ...
At the pre-commit stage, following a list of uncommitted files and using git lfs track and git add sequentially, you should be safe.
source share