57
you are viewing a single comment's thread
view the rest of the comments
[-] NostraDavid@programming.dev 11 points 1 day ago* (last edited 1 day ago)

I prefer to flip the logic of the .gitignore.

# ignore root files/folders
/*

# unignore files
!.gitignore
!README.md
!Justfile
!flake.nix
!flake.lock
!pyproject.toml
!.python-version
!uv.lock

# unignore folders
!src/
!docs/

# reignore (recursively)
__pycache__

This includes the files and folders (and their subfiles/folders), while recursively ignoring any pycache bullshit.

  • Small
  • Maintainable
  • Easy to change
  • Readable
[-] MantisWaffle@lemmy.world 1 points 9 hours ago* (last edited 9 hours ago)

Why do you have __pycache__? Is it not already ignored by the catch-all rule at the beginning?

load more comments (1 replies)
this post was submitted on 11 Feb 2026
57 points (95.2% liked)

Programming

25502 readers
320 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS