Re: Clean up stale .gitignore and .gitattribute patterns
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 23, 2023, 17:26 UTC
- Message-ID
- <xmqqcz1may4g.fsf@gitster.g>
- In-Reply-To
- <CAHGBnuOR+MU50jhNBHw8buWS_Yr9D92mErvgoi=cK16a=4_YUA@mail.gmail.com>
Sebastian Schuberth <sschuberth@gmail.com> writes:
> is there a command to easily check patterns in .gitignore and > .gitattributes to still match something? I'd like to remove / correct > patterns that don't match anything anymore due to (re)moved files.
I guess "git check-attr --stdin" and "git check-ignore --stdin" will be part of the solution to your problem, but I do not know what the other parts would be.
Feeding "ls-files" output to "check-ignore --stdin" feels sort-of oxymoron because by definition the output from "ls-files" cannot contain any ignored paths.