From: Junio C Hamano Date: Fri, 23 Jun 2023 17:26:23 GMT Subject: Re: Clean up stale .gitignore and .gitattribute patterns Message-ID: In-Reply-To: Sebastian Schuberth 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.