gitgit-ls-files

How to exclude already tracked files from git ls-files?


Our team use flowtype, and git tracked files under the flow-typed directory. I want to hide those files shown by git ls-files. Those files are already tracked, —exclude option does not seem to work, .git/info/exclude too. Does anyone have good idea?


Solution

  • Only a few team member needs those files, but noisy for me

    Then you could consider marking those files as "unmodified" (even if they are) with it update-index --assume-unchanged <filename>.
    That, in addition of using git ls-files --other, if you want to focus on untracked files.

    As the OP yakulto comments:

    git ls-files shows already tracked files anyway, because git ls-files to show tracked files!
    If I feel noisy and don't want to show ls-files result, simply, I should use other command like find, ls | grep.