Sahih Muslim , Hadith 564

Jabir reported: The Messenger of Allah said: He who eats garlic or onion should remain away from us or from our mosque and stay in his house. A kettle was brought to him which had (cooked) vegetables in it, He smelt (offensive) odour in it. On asking he was informed of the vegetables (cooked in it). He said: Take it to such and such Companion. When he saw it, he also disliked eating it. (Upon this). he (the Holy Prophet) said: You may eat it, for I converse wkh one with whom you do not converse.

وَحَدَّثَنِي أَبُو الطَّاهِرِ، وَحَرْمَلَةُ، قَالاَ أَخْبَرَنَا ابْنُ وَهْبٍ، أَخْبَرَنِي يُونُسُ، عَنِ ابْنِ شِهَابٍ، قَالَ حَدَّثَنِي عَطَاءُ بْنُ أَبِي رَبَاحٍ، أَنَّ جَابِرَ بْنَ عَبْدِ اللَّهِ، قَالَ - وَفِي رِوَايَةِ حَرْمَلَةَ وَزَعَمَ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏"‏ مَنْ أَكَلَ ثُومًا أَوْ بَصَلاً فَلْيَعْتَزِلْنَا أَوْ لِيَعْتَزِلْ مَسْجِدَنَا وَلْيَقْعُدْ فِي بَيْتِهِ ‏"‏ ‏.‏ وَأَنَّهُ أُتِيَ بِقِدْرٍ فِيهِ خَضِرَاتٌ مِنْ بُقُولٍ فَوَجَدَ لَهَا رِيحًا فَسَأَلَ فَأُخْبِرَ بِمَا فِيهَا مِنَ الْبُقُولِ فَقَالَ ‏"‏ قَرِّبُوهَا ‏"‏ ‏.‏ إِلَى بَعْضِ أَصْحَابِهِ فَلَمَّا رَآهُ كَرِهَ أَكْلَهَا قَالَ ‏"‏ كُلْ فَإِنِّي أُنَاجِي مَنْ لاَ تُنَاجِي ‏"‏ ‏.‏

sunnah.com

Jabir b. 'Abdullah reported the Messenger of Allah mying: He who eats of this (offensive) plant, i. e garlic, and sometirres he said: He who eats onion and garlic and leek, should not approach our mosque for the angels are harmed by the same things as the children of Adam.

وَحَدَّثَنِي مُحَمَّدُ بْنُ حَاتِمٍ، حَدَّثَنَا يَحْيَى بْنُ سَعِيدٍ، عَنِ ابْنِ جُرَيْجٍ، قَالَ أَخْبَرَنِي عَطَاءٌ، عَنْ جَابِرِ بْنِ عَبْدِ اللَّهِ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏ "‏ مَنْ أَكَلَ مِنْ هَذِهِ الْبَقْلَةِ الثُّومِ - وَقَالَ مَرَّةً مَنْ أَكَلَ الْبَصَلَ وَالثُّومَ وَالْكُرَّاثَ - فَلاَ يَقْرَبَنَّ مَسْجِدَنَا فَإِنَّ الْمَلاَئِكَةَ تَتَأَذَّى مِمَّا يَتَأَذَّى مِنْهُ بَنُو آدَمَ ‏" ‏ ‏.‏

sunnah.com

Ibn Juraij has narrated it with the same chain of transmitters: He who eats of this plant, i. e. garlic, should not come to us in our mosque, and he made no mention of onions or leek.

وَحَدَّثَنَا إِسْحَاقُ بْنُ إِبْرَاهِيمَ، أَخْبَرَنَا مُحَمَّدُ بْنُ بَكْرٍ، ح قَالَ وَحَدَّثَنِي مُحَمَّدُ بْنُ رَافِعٍ، حَدَّثَنَا عَبْدُ الرَّزَّاقِ، قَالاَ جَمِيعًا أَخْبَرَنَا ابْنُ جُرَيْجٍ، بِهَذَا الإِسْنَادِ ‏ "‏ مَنْ أَكَلَ مِنْ هَذِهِ الشَّجَرَةِ - يُرِيدُ الثُّومَ - فَلاَ يَغْشَنَا فِي مَسْجِدِنَا ‏" ‏ ‏.‏ وَلَمْ يَذْكُرِ الْبَصَلَ وَالْكُرَّاثَ ‏.‏

sunnah.com