How can I see list of ignored files in git?

后端 未结 3 1239
轮回少年
轮回少年 2021-01-06 06:41

I have been using git from past few months and I like git. I was wondering if there is a command which can show list of ignored files in a project.

I tried this

3条回答
  •  花落未央
    2021-01-06 07:02

    1. find -type f | git check-ignore --stdin gives all files ignored in whole repo (and if you have some in .git that fit, it will report them too).
    2. git ls-files --exclude-standard --ignored --others - gives ignored file per current directory (not whole repository).

    Both solutions honor not just top-level .gitignore file, but also global one, .git/info/exclude and local (in lower-level dirs) .gitignores

提交回复
热议问题