Jabir bin Abdullah reported,

The Messenger of Allah ﷺ said, "Whoever eats garlic or onions should keep away from us," or he said, "should keep away from our mosque and remain in his house."A pot containing some green vegetables was once brought to him. He noticed an odor coming from it and asked about it, and he was told what vegetables were in it. He said, "Bring it close to one of my companions."When the companion saw it, he disliked eating from it. The Prophet ﷺ said to him, "Eat, for I converse privately with one with whom you do not converse."

Azami 7401

Sahih

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

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

الأعظمي 7401صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Foods
Chapter
Foods other than meat
Section
Eating garlic, onions, and leeks
Numbering
Jami al-Kamil 7401 (2nd edition)
Azami 7401