Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# from https://stackoverflow.com/questions/16244969/how-to-tell-git-to-ignore-individual-lines-i-e-gitignore-for-specific-lines-of
# Run the following command:
git config --global filter.gitignore.clean "sed '/#gitignore$/d'"
# Now, either add a local file in .git/info/attributes
echo "*.extension_to_be_ignored filter=gitignore" > ./.git/info/attributes
# or write into a file that will be part of your code
echo "path_to_file_with_the_ignore_directive filter=gitignore" > ./.gitattributes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment