Narrated At’a: I heard Jabir bin Abdullah saying that the Prophet, peace be upon him, said, “Whosoever eats (from) this plant (he meant garlic) should keep away from our mosque.” I said, “What does he mean by that?” He replied, “I think he means only raw garlic.”
[1: 813- O.B. Sahih Al-Bukhari] [486]

Narrated Jabir bin Abdullah: The Prophet, peace be upon him, said, “Whoever eats garlic or onion should keep away from us, or keep away from our mosque or should remain in his house.”

In another narration Jabir bin Abdullah said that once a big pot [or a dish] containing (cooked) vegetables was brought. On noticing unpleasant smell coming from it, the Prophet, peace be upon him, asked, “What is in it?” He was told all the names of the vegetables that were in it. The Prophet ordered that it should be placed near some of his companions who were with him. When the Prophet, peace be upon him, saw it he disliked to eat it and said, “Eat (I don’t eat) for I converse with those whom you don’t converse with (i.e. angels).”
[1: 814- O.B. Sahih Al-Bukhari)