The Messenger of Allah ﷺ performed tamattu during the Farewell Pilgrimage by combining Umra with Hajj, and he brought a sacrificial offering with him, driving it along from Dhul Hulayfa. The Messenger of Allah began by entering the state of ihram for Umra, then he entered ihram for Hajj. The people too performed tamattu with the Prophet ﷺ, combining Umra with Hajj. Some of them had brought sacrificial animals and driven them along, while others had not.When the Prophet ﷺ arrived in Makkah, he said to the people, "Whoever among you has brought a sacrificial offering, nothing that is forbidden during ihram becomes lawful for him until he completes his Hajj. And whoever among you has not brought a sacrificial offering should circumambulate the House, walk between Safa and Marwa, shorten his hair, and exit ihram. Then let him enter ihram again for Hajj. Whoever cannot find a sacrificial animal should fast three days during the Hajj and seven days when he returns to his family."
تمتع رسول الله ﷺ في حجة الوداع بالعمرة إلى الحج وأهدى فساق معه الهدي من ذي الحليفة وبدأ رسول الله، فأهل بالعمرة، ثم أهل بالحج فتمتع الناس مع النبي ﷺ بالعمرة إلى الحج فكان من الناس من أهدى فساق الهدي، ومنهم من لم يهد، فلما قدم النبي ﷺ مكة قال للناس: من كان منكم أهدى فإنه لا يحل لشيء حرم منه حتى يقضي حجه، ومن لم يكن منكم أهدى فليطف بالبيت وبالصفا والمروة وليقصر وليحلل، ثم ليهل بالحج، فمن لم يجد هديا فليصم ثلاثة أيام في الحج، وسبعة إذا رجع إلى أهله.
Bukhari narrated it in the chapter on Hajj (1691), and this is his wording. Muslim also narrated it in the chapter on Hajj (1227). Both narrated it through Layth bin Saad, who said, Aqeel bin Khalid narrated to me, from Ibn Shihab, from Salim bin Abdullah, that Abdullah bin Umar mentioned it in full.His saying, "and let him shorten," means shortening his hair. They were instructed to shorten it because they were close to entering the state of ihram for Hajj, so that they would still be able to shave their heads during Hajj, shaving being more excellent than shortening.