Sahih al-Bukhari, Book 70, Hadith 80 (Bukhari 5238)

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."