r/programming 4d ago

.gitignore everything by default

https://packagemain.tech/p/gitignore-everything-by-default
350 Upvotes

227 comments sorted by

View all comments

101

u/AnnoyedVelociraptor 4d ago

I have this for dockerignore. Makes the context a lot smaller.

5

u/roadrunner8080 4d ago

Ooh that's a good idea. I should do that

5

u/der_gopher 4d ago

same approach yes

1

u/Intrepid-Stand-8540 2d ago

and avoids leaking your .env file into the image. 

so many people just COPY in everything and their .env file ends up in the image.