Jabir bin Abdullah reported,

The Prophet ﷺ said, "Whoever eats garlic or onion should keep away from us," or, "should keep away from our mosque and stay in his house."A badr was brought to him. Ibn Wahb said this means a tray containing some green vegetables. He noticed an odor coming from it and asked about it, and he was told what vegetables it contained. He said, "Bring it close." So they brought it close to one of his companions who was with him. When the companion saw that the Prophet ﷺ disliked eating it, he said, "Eat, for I converse privately with one with whom you do not converse."Ibn Ufayr reported from Ibn Wahb, "a pot containing some green vegetables." Layth and Abu Safwan, reporting from Yunus, did not mention the matter of the pot, so I do not know whether it is from the words of Zuhri or part of the hadith.

Bukhari 7359

Sahih

حدثنا أحمد بن صالح حدثنا ابن وهب أخبرني يونس عن ابن شهاب أخبرني عطاء بن أبي رباح

عن جابر بن عبد الله قال

قال النبي ﷺ من أكل ثوما أو بصلا فليعتزلنا أو ليعتزل مسجدنا وليقعد في بيته وإنه أتي ببدر قال ابن وهب يعني طبقا فيه خضرات من بقول فوجد لها ريحا فسأل عنها فأخبر بما فيها من البقول فقال قربوها فقربوها إلى بعض أصحابه كان معه فلما رآه كره أكلها قال كل فإني أناجي من لا تناجي وقال ابن عفير عن ابن وهب بقدر فيه خضرات ولم يذكر الليث وأبو صفوان عن يونس قصة القدر فلا أدري هو من قول الزهري أو في الحديث

البخاري 7359صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Adhering to the Book and the Sunnah
Chapter
Rulings that are known through proofs, and the meaning and interpretation of evidence
Numbering
Darussalam 7359
Bukhari 7359