Sahih Muslim
Sahih Muslim 1856 c
It is recommended for the army to swear allegiance to the ruler when intending to fight, and an account of Bay'at Ar-Ridwan beneath the tree
Arabic hadith text
وَحَدَّثَنَا مُحَمَّدُ بْنُ حَاتِمٍ، حَدَّثَنَا حَجَّاجٌ، عَنِ ابْنِ جُرَيْجٍ، أَخْبَرَنِي أَبُو الزُّبَيْرِ، سَمِعَ جَابِرًا، يُسْأَلُ كَمْ كَانُوا يَوْمَ الْحُدَيْبِيَةِ قَالَ كُنَّا أَرْبَعَ عَشْرَةَ مِائَةً فَبَايَعْنَاهُ وَعُمَرُ آخِذٌ بِيَدِهِ تَحْتَ الشَّجَرَةِ وَهِيَ سَمُرَةٌفَبَايَعْنَاهُ غَيْرَ جَدِّ ابْنِ قَيْسٍ الأَنْصَارِيِّ اخْتَبَأَ تَحْتَ بَطْنِ بَعِيرِهِ
Translation
It has been narrated on the authority of Abu Zubair who heard Jabir being questioned as to how many people were there on the Day of Hudaibiya. He replied
We were fourteen hundred. We swore fealty to him, and Umar was holding his hand while he was sitting under the tree (to administer the oath). The tree was a samura (a wild tree found in deserts). All of as took the oath of fealty at his hands except Jadd b. Qais al-Ansari who hid himself under the belly of his camel.