The Prophet ﷺ asked him, "With what did you enter into ihram, Ali?"He replied, "With the same as what the Prophet ﷺ entered into ihram with."He said, "Then offer the sacrifice and remain in ihram as you are."And Ali brought a sacrificial animal for him.
أخبرني عمران بن يزيد قال حدثنا شعيب عن ابن جريج قال عطاء قال جابر قدم
له النبي ﷺ بما أهللت يا علي قال بما أهل به النبي ﷺ قال فاهد وامكث حراما كما أنت قال وأهدى علي له هديا
Bukhari transmitted it in the Book of Military Expeditions, chapter on the sending of Ali bin Abu Talib and Khalid, no. 4352, and Muslim in the Book of Hajj, chapter explaining the forms of ihram and that it is permissible to perform Hajj alone, or as tamattu, or as qiran, etc., no. 1216, from the hadith of Ibn Jurayj, at greater length, and it is also found in Kubra, no. 3725.