Once someone asked Hazrat Anas (may Allah be pleased with him) about garlic, so he replied that the Prophet (peace and blessings be upon him) said: Whoever eats from this tree should not come near us, or should not pray with us.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 12937