Sahih Muslim , Hadith 1858

It has been narrated on the authority of Ma'qil b. Yasar who aaid: I remember being present on the Day of the Tree, and the Prophet was taking the oath of the people and I was holding a twig of the tree over his head. We were fourteen hundred (in number). We did not take oath to the death, but to the effect that we would not run away from the battlefield.

وَحَدَّثَنَا يَحْيَى بْنُ يَحْيَى، أَخْبَرَنَا يَزِيدُ بْنُ زُرَيْعٍ، عَنْ خَالِدٍ، عَنِ الْحَكَمِ بْنِ عَبْدِ اللَّهِ، بْنِ الأَعْرَجِ عَنْ مَعْقِلِ بْنِ يَسَارٍ، قَالَ لَقَدْ رَأَيْتُنِي يَوْمَ الشَّجَرَةِ وَالنَّبِيُّ صلى الله عليه وسلم يُبَايِعُ النَّاسَ وَأَنَا رَافِعٌ غُصْنًا مِنْ أَغْصَانِهَا عَنْ رَأْسِهِ وَنَحْنُ أَرْبَعَ عَشْرَةَ مِائَةً قَالَ لَمْ نُبَايِعْهُ عَلَى الْمَوْتِ وَلَكِنْ بَايَعْنَاهُ عَلَى أَنْ لاَ نَفِرَّ ‏.‏

sunnah.com

This hadith has been narrated on the authority of Yunus with the same chain of transmitters.

وَحَدَّثَنَاهُ يَحْيَى بْنُ يَحْيَى، أَخْبَرَنَا خَالِدُ بْنُ عَبْدِ اللَّهِ، عَنْ يُونُسَ، بِهَذَا الإِسْنَادِ.

sunnah.com