Hidden files get checked/built in all the time. Too many people don’t think to look for them.
# Ignore everything
*
# But not these files...
!/.gitignore
!*.go
!go.sum
!go.mod
It’s the least shit solution, but it’s definitely a shit solution.
Npm has another way to default exclude but I don’t think git does, and if docker got one I don’t recall what it is.