Babies spit up for a million reasons. The main reason is that they are still new and everything doesn't work the way it should. Sometimes they try to poop, and instead their bodies push things up instead of down.
Food intolerance causes fussiness, gas, diarrhea, cough, congestion, runny noses, etc. but not spit up. DS had food intolerances when I ate certain foods, and he did spit up, but the drs reassured me that the two are not related.
DD proves them right. She has no food intolerances, but she spits up an entire feeding some times; even if it has been more then an hour since she has eaten.
But, to answer your question, it depends on what you eat and drink. What you drink can start affecting your breast milk very quickly; within a few minutes. (Like alcohol and milk.) Food takes an hour or two to affect the taste/consistency of your BM. Or so my LC told me.