The Messenger of Allah ﷺ garlanded the sacrificial animal and marked it at Dhul-Hulayfah, then entered the state of consecration from there for an Umra. He shaved his head at al-Hudaybiyah during his Umra and ordered his companions to do the same. He sacrificed the animal at al-Hudaybiyah before shaving his head and ordered his companions to do likewise.
حدثنا عبد الرزاق أخبرنا معمر عن الزهري عن عروة بن الزبير
قلد رسول الله ﷺ الهدي وأشعره بذي الحليفة وأحرم منها بالعمرة حلق بالحديبية في عمرته وأمر أصحابه بذلك ونحر بالحديبية قبل أن يحلق وأمر أصحابه بذلك
Its isnad is sahih, and it is found in Bukhari 2/207, in the book of Hajj, chapter on marking and garlanding the sacrificial animal, and Abu Dawud 3/85, no. 2765, in the book of jihad, chapter on making peace with the enemy, and Nasai 5/170, no. 2772, in the book of Hajj, chapter on marking the sacrificial animal.