The Prophet ﷺ entered the state of ihram for Hajj. When he arrived, he performed tawaf around the Kabah and walked between Safa and Marwa, but he did not shorten his hair or exit the state of ihram, because he had brought sacrificial animals with him. He instructed those who had not brought sacrificial animals to perform tawaf, do the saee, shorten or shave their hair, and then exit the state of ihram.
حدثنا هشيم أخبرنا يزيد بن أبي زياد عن مجاهد
أهل النبي ﷺ بالحج فلما قدم طاف بالبيت وبين الصفا والمروة ولم يقصر ولم يحل من أجل الهدي وأمر من لم يكن ساق الهدي أن يطوف وأن يسعى ويقصر أو يحلق ثم يحل