Skip to content

Instantly share code, notes, and snippets.

@gnthibault
Created March 16, 2022 14:30
Show Gist options
  • Save gnthibault/fdc23d9f067e176bee6971892ff5f4c6 to your computer and use it in GitHub Desktop.
Save gnthibault/fdc23d9f067e176bee6971892ff5f4c6 to your computer and use it in GitHub Desktop.
# 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