Maybe the problem can't be fixed. As long as techies remain predominately male, this problem will persist.
And why are they predominately male? Either-
A: Men, for some unknown reason, like programming better.
B: The sexist environment drives women away.
Whichever one it is, the problem will not resolve itself. For A, as long as men like it better, and there are more of them, women will be seen as outsiders.
For B, as long there are more men, some of whom are sexist, the women will be driven away and the ratio of m/f will stay the same.