Ali came to the Messenger of Allah ﷺ from Yemen, and the Prophet ﷺ asked him, "With what intention did you enter ihram?"Ali replied, "I entered ihram with the same intention as the Messenger of Allah ﷺ."He said, "Were it not that I have the sacrificial animal with me, I would have exited ihram."
حدثنا عبد الوارث بن عبد الصمد بن عبد الوارث قال حدثنا أبي حدثنا سليم بن حيان قال سمعت مروان الأصفر
أن عليا قدم على رسول الله ﷺ من اليمن فقال بم أهللت قال أهللت بما أهل به رسول الله ﷺ قال لولا أن معي هديا لأحللت
Agreed upon [by Bukhari and Muslim]. Bukhari narrated it in the Book of Hajj, chapter of one who entered ihram during the time of the Prophet ﷺ in the same manner as the Prophet's ihram, no. 1558, and Muslim, no. 1250, from the hadith of Abdul-Samad bin Abdul-Warith, with the same wording, 1558.