CombatWombatEsq@lemmy.world to Programming@programming.dev · 2 days ago🧐 TIL: global .gitignoredandean.comexternal-linkmessage-square27fedilinkarrow-up158
arrow-up158external-link🧐 TIL: global .gitignoredandean.comCombatWombatEsq@lemmy.world to Programming@programming.dev · 2 days agomessage-square27fedilink
minus-squareNostraDavid@programming.devlinkfedilinkarrow-up9·edit-21 day agoI 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
minus-squareCombatWombatEsq@lemmy.worldOPlinkfedilinkarrow-up3·1 day agoI like this solution a lot. I hope I remember it the next time I initialize a repository.
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.
I like this solution a lot. I hope I remember it the next time I initialize a repository.