Language:
كتاب الأذان
10  
Call to Prayers (Adhaan)
(160)
Chapter: What has been said about uncooked garlic, onion and leek.
(160)
باب مَا جَاءَ فِي الثُّومِ النَّىِّ وَالْبَصَلِ وَالْكُرَّاثِ
Sahih al-Bukhari 856

Narrated `Abdul `Aziz:

A man asked Anas, "What did you hear from the Prophet (ﷺ) about garlic?" He said, "The Prophet (ﷺ) said, 'Whoever has eaten this plant should neither come near us nor pray with us."

حَدَّثَنَا أَبُو مَعْمَرٍ، قَالَ حَدَّثَنَا عَبْدُ الْوَارِثِ، عَنْ عَبْدِ الْعَزِيزِ، قَالَ سَأَلَ رَجُلٌ أَنَسًا مَا سَمِعْتَ نَبِيَّ اللَّهِ صلى الله عليه وسلم فِي الثُّومِ فَقَالَ قَالَ النَّبِيُّ صلى الله عليه وسلم ‏ "‏ مَنْ أَكَلَ مِنْ هَذِهِ الشَّجَرَةِ فَلاَ يَقْرَبْنَا، أَوْ لاَ يُصَلِّيَنَّ مَعَنَا ‏"‏‏.‏
Reference : Sahih al-Bukhari 856
In-book reference : Book 10, Hadith 247
USC-MSA web (English) reference : Vol. 1, Book 12, Hadith 815
  (deprecated numbering scheme)