Why are themes in repository not ignored, too?

Because if you want to ignore it, you can.

Most people develop their theme locally, commit to git, and then push. You’re just being special.