Language:
كتاب الأطعمة
70  
Food, Meals
(49)
Chapter: The eating of garlic or other (bad smelling vegetables).
(49)
باب مَا يُكْرَهُ مِنَ الثُّومِ وَالْبُقُولِ
Sahih al-Bukhari 5451

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

حَدَّثَنَا مُسَدَّدٌ، حَدَّثَنَا عَبْدُ الْوَارِثِ، عَنْ عَبْدِ الْعَزِيزِ، قَالَ قِيلَ لأَنَسٍ مَا سَمِعْتَ النَّبِيَّ صلى الله عليه وسلم فِي الثُّومِ فَقَالَ ‏ "‏ مَنْ أَكَلَ فَلاَ يَقْرَبَنَّ مَسْجِدَنَا ‏"‏‏.‏
Reference : Sahih al-Bukhari 5451
In-book reference : Book 70, Hadith 80
USC-MSA web (English) reference : Vol. 7, Book 65, Hadith 362
  (deprecated numbering scheme)