I haven't looked at Alicorn's data, but when I get a headache my first two hypotheses are that its caused by either dehydration or caffeine withdrawal. Either I drink something caffeinated or drink about 16-24 fluid ounces of water and then re-assess after about 20 minutes. If whichever I tried doesn't work then I do the other thing plus take a pain killer (choosing between aspirin, acetaminophen, or ibuprofen based on other considerations) because by that point I just want the problem to go away rather than to gain a bit of information about which particular solution fixed things. Usually, my first experiment works and no pain pill is required.
Caffeine is a diuretic (meaning it makes you pee) meaning you have to drink more than otherwise in the long run to balance this effect.
Something potentially worth noting if you're drinking a lot of green tea is that its cancer preventing effects appear to follow a dose response curve that has been experimentally observed up to six or seven cups a day, so drinking a lot of it can be worthwhile if that's important to you. Green tea's cancer-protecting mechanism is probably a body-wide up-regulation of apoptosis (programmed cell death) killing potentially cancerous cells earlier than otherwise. One minor worry with this (that I've never seen addressed in the literature which is more of an untrustworthy pet theory of mine) is that apoptosis up-regulation can presumably cause more neurons to die and apoptosis inhibiting mutations like BRCA1 have been suggested as leading to higher IQ. My guess is that there may be a trade-off here between raw biological longevity and high fluid intelligence.
I've been collecting data about my headaches and diet for almost four months now. I don't see any patterns - annoyingly, I get headaches nearly every day, so there's not much information - but I thought I'd post the data set and see if anyone sees anything. Here it is. Hopefully someone finds this an interesting problem.
It's written in note-to-self format (abbreviations like "strawbs" for "strawberries"; if I mention a complicated dish once then I'll shorten it when I eat the leftovers, as "pasta" for "pasta with artichokes and spinach and pesto"; times given approximately and not in a consistent form and often without specifying if they're a.m. or p.m., though they are in chronological order). Quantities aren't given, although if they're suspected to be relevant I may be able to remember specific instances (for unusual foods) or typical portions (for ordinary foods) - other details might also be recollectable similarly. I also don't notice when headaches go away, so I don't know how long they last except when they last all day or become noticeably worse during their course. My sleep schedule varied considerably over this period, but trends more night owl than early bird (for a while I was outright nocturnal). I moved three time zones west at the end of July, should that matter at all.
I'm not soliciting commentary on my diet except insofar as it can be compellingly related to my headaches.
ETA: Assume that every single day I'm drinking lots of skim milk. (2-6 cups depending on how much I eat and how it's spaced out.) There's a couple of exceptions, mostly when I'm in transit for most of a day or run out of milk, but not many and they don't seem to correlate with headaches.