How do I get ird of menstrual migranes?

Hormones. Menstrual migraines are thought to be triggered by the abrupt drop in Progesterone that occurs right before menses begins. Some patients get very good relief from supplemental Progesterone creams or pills taken the week before menstruation begins, and also, low dose birth control pills often help (especially if using a regimen that includes 24 days of active pills instead of 21, or 'extended-regim.
See the doctor. There are many different medications including a class of drugs known as triptans which may help. Discuss with your doctor.