Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:5050Abū ʿAbdullāh al-Ḥāfiẓ > Abū Bakr Aḥmad b. Isḥāq al-Faqīh Imlāʾ > Mūsá b. Isḥāq al-Qāḍī > ʿAbdullāh b. Abū Shaybah > Ibn Numayr > ʿUbaydullāh b. ʿUmar > Nāfiʿ > Ibn ʿUmar

[Machine] The Messenger of Allah ﷺ said, "Whoever eats from this onion, let him not come near our mosque until its smell has gone away, meaning garlic."  

البيهقي:٥٠٥٠وَأَخْبَرَنَا أَبُو عَبْدِ اللهِ الْحَافِظُ ثنا أَبُو بَكْرٍ أَحْمَدُ بْنُ إِسْحَاقَ الْفَقِيهُ إِمْلَاءً أنبأ مُوسَى بْنُ إِسْحَاقَ الْقَاضِي ثنا عَبْدُ اللهِ بْنُ أَبِي شَيْبَةَ ثنا ابْنُ نُمَيْرٍ ثنا عُبَيْدُ اللهِ بْنُ عُمَرَ عَنْ نَافِعٍ عَنِ ابْنِ عُمَرَ

أَنَّ رَسُولَ اللهِ ﷺ قَالَ مَنْ أَكَلَ مِنْ هَذِهِ الْبَقْلَةِ فَلَا يَقْرَبَنَّ مَسْجِدَنَا حَتَّى يَذْهَبَ رِيحُهَا يَعْنِي الثُّومَ  

رَوَاهُ مُسْلِمٌ فِي الصَّحِيحِ عَنْ أَبِي بَكْرِ بْنِ أَبِي شَيْبَةَ وَرَوَاهُ أَيْضًا أَنَسُ بْنُ مَالِكٍ وَأَبُو هُرَيْرَةَ وَغَيْرُهُمَا

See similar narrations below:

Collected by Muslim, Mālik
muslim:561b[Chain 1] Abū Bakr b. Abū Shaybah > Ibn Numayr [Chain 2] Muḥammad b. ʿAbdullāh b. Numayr from my father > ʿUbaydullāh > Nāfiʿ > Ibn ʿUmar

The Messenger of Allah ﷺ said: He who eats of this (offensive) plant must not approach our mosque, till its odor dies: (plant signifies) garlic.  

مسلم:٥٦١bحَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ حَدَّثَنَا ابْنُ نُمَيْرٍ ح قَالَ وَحَدَّثَنَا مُحَمَّدُ بْنُ عَبْدِ اللَّهِ بْنِ نُمَيْرٍ وَاللَّفْظُ لَهُ حَدَّثَنَا أَبِي قَالَ حَدَّثَنَا عُبَيْدُ اللَّهِ عَنْ نَافِعٍ عَنِ ابْنِ عُمَرَ

أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ مَنْ أَكَلَ مِنْ هَذِهِ الْبَقْلَةِ فَلاَ يَقْرَبَنَّ مَسَاجِدَنَا حَتَّى يَذْهَبَ رِيحُهَا يَعْنِي الثُّومَ  

malik:1-30Yaḥyá > Mālik > Ibn Shihāb > Saʿīd b. al-Musayyab

Yahya related to me from Malik from Ibn Shihab from Said ibn al- Musayyab that the Messenger of Allah ﷺ said, "Anyone who eats this plant should not come near our mosques. The smell of the garlic will offend us."  

مالك:١-٣٠حَدَّثَنِي يَحْيَى عَنْ مَالِكٍ عَنِ ابْنِ شِهَابٍ عَنْ سَعِيدِ بْنِ الْمُسَيَّبِ

أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ مَنْ أَكَلَ مِنْ هَذِهِ الشَّجَرَةِ فَلاَ يَقْرُبْ مَسَاجِدَنَا يُؤْذِينَا بِرِيحِ الثُّومِ