Skip to content

Instantly share code, notes, and snippets.

@NostraDavid
Last active December 23, 2021 14:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NostraDavid/743a901376660c5a2b01c1d83b4d34ed to your computer and use it in GitHub Desktop.
Save NostraDavid/743a901376660c5a2b01c1d83b4d34ed to your computer and use it in GitHub Desktop.
Whitelisting gitignore, instead of the default blacklisting.
# ignore all root items, not recursively
/*
# whitelist dirs
!docs
!example_data
!requirements
!src
!tests
# whitelist files
!.env.dist
!.gitattributes
!.gitconfig
!.gitignore
!.pre-commit-config.yaml
!MANIFEST.in
!pyproject.toml
!README.md
!Requirements.md
!setup.py
!tox.ini
# recursively blacklist these (in case they pop up in a whitelisted folder)
__pycache__
*.egg-info
*.pyc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment