Sahih Muslim
Sahih Muslim 1857 b
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
The same tradition has been handed down through a different chain of transmitters.