Maqil bin Yasar reported,

I remember myself on the day of the Tree, when the Prophet ﷺ was taking the people's pledge of allegiance, and I was lifting a branch of it away from his head. We were one thousand four hundred. He said, "We did not pledge to him to die, but we pledged to him that we would not flee."

Muslim 4817

Sahih

و حدثنا يحيى بن يحيى أخبرنا يزيد بن زريع عن خالد عن الحكم بن عبد الله بن الأعرج

عن معقل بن يسار قال

لقد رأيتني يوم الشجرة والنبي ﷺ يبايع الناس وأنا رافع غصنا من أغصانها عن رأسه ونحن أربع عشرة مائة قال لم نبايعه على الموت ولكن بايعناه على أن لا نفر

مسلم 4817صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Leadership
Chapter
Recommendation of pledging allegiance to the commander of the army when intending to fight, and description of the pledge of Ridwan under the tree
Numbering
Darussalam 4817
Muslim 4817