2

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?

yakulto
  • 23
  • 2
  • The main purpose of `git ls-files` is to show tracked files, so this question does not seem to make sense; but see `git ls-files --other` which shows only the *untracked* files. – torek Jul 12 '18 at 14:23
  • That’s true for sure! Only a few team member needs those files, but noisy for me. so I want to hide them from `git ls-files`, but that’s not point, right? – yakulto Jul 12 '18 at 15:14

1 Answers1

1

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.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you for your reply! I tried `git udpate-index --assume-unchanged flow-typed/npm/aws-sdk_vx.x.x.js` (it's aws-sdk's definition file), and then `git ls-files --other | grep flow-typed/npm/aws-sdk_vx.x.x.js`, nothing is shown. Did I make a mistake? – yakulto Jul 13 '18 at 06:29
  • @yakulto Considering `git ls-files --other` shows only *untracked`files, that is expected: `flow-typed/npm/aws-sdk_vx.x.x.js` is tracked already. All what `git udpate-index --assume-unchanged flow-typed/npm/aws-sdk_vx.x.x.js` does is preventing it to show up in `git status` as modified: you would ignore any new modification. – VonC Jul 13 '18 at 06:31
  • Ok, now I see. `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`. thanks @VonC and @torek! – yakulto Jul 13 '18 at 06:56