A way to validate .gitignore file

前端 未结 3 911
夕颜
夕颜 2020-12-16 15:56

Is there a way to validate a .gitignore file so you quickly find doubles paths or paths that don\'t exist anymore? Normally when a project is small this isn\'t really necess

3条回答
  •  温柔的废话
    2020-12-16 16:06

    In order to also validate git's ** pattern in paths I had to write a one-liner inspired by the script above:

    find . -type f | git check-ignore -v --stdin | perl -pe 's,.*\.gitignore:,,; s,\t," "x100,e' | sort | uniq -w 100 -c | perl -pe 's, {100}.*,,'
    

    Not exactly pretty but it works.

提交回复
热议问题