Sahih Muslim, Book 5, Hadith 89 (Muslim 1242)

Abu Huraira reported:

The Messenger of Allah (ﷺ) said: He who eats of this plant (garlic) should not approach our mosque and should not harm us with the odour of garlic.