Volume 7 · Book 65 · Hadith 362
Narrated 'Abdul 'Aziz: It was said to Anas "What did you hear the Prophet saying about garlic?" Anas replied, "Whoever has eaten (garlic) should not approach our mosque."
— Sahih Bukhari, Volume 7, Book 65: Food, Meals, Hadith #362