killchain-compendium/Exploits/Git/Git Attributes.md

593 B

Git Attributes

Git Attributes can be used to introduce scripts modifying files before pushing. That means the you can prepare a scripts for example linting by filtetype, and call it via attributes afterwards. Therefore, you need to create an attributes file at .git/info/attributes. Insert something that makes sense, e.g.

echo "*.py filter=indent" > .git/info/attributes

reference the file as the filter via

git config filter.indent.clean /dev/shm/$MALICIOUS_FILE

Push to origin afterwards to trigger the filter file