كتاب الإمارة
33  
The Book on Government
(18)
Chapter: 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
(18)
باب اسْتِحْبَابِ مُبَايَعَةِ الإِمَامِ الْجَيْشَ عِنْدَ إِرَادَةِ الْقِتَالِ وَبَيَانِ بَيْعَةِ الرِّضْوَانِ تَحْتَ الشَّجَرَةِ
Sahih Muslim 1860 b

The above tradition has also been handed down through a different chain of transmitters.

وَحَدَّثَنَاهُ إِسْحَاقُ بْنُ إِبْرَاهِيمَ، حَدَّثَنَا حَمَّادُ بْنُ مَسْعَدَةَ، حَدَّثَنَا يَزِيدُ، عَنْ سَلَمَةَ، بِمِثْلِهِ ‏.‏
Reference : Sahih Muslim 1860b
In-book reference : Book 33, Hadith 119
USC-MSA web (English) reference : Book 20, Hadith 4591
  (deprecated numbering scheme)