It is narrated from Sayyiduna Ala' bin Khabbab (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Whoever eats from this foul-smelling plant, let him not come near our mosque" - I mean garlic.
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 15268