كتاب الإمارة
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 1859 c

The tradition has been narrated on the authority of Sa'id b. Musayyib who learnt it from his father. The latter said:

I had seen the tree. When I came to the spot afterwards, I could not recognise it.
وَحَدَّثَنِي حَجَّاجُ بْنُ الشَّاعِرِ، وَمُحَمَّدُ بْنُ رَافِعٍ، قَالاَ حَدَّثَنَا شَبَابَةُ، حَدَّثَنَا شُعْبَةُ، عَنْ قَتَادَةَ، عَنْ سَعِيدِ بْنِ الْمُسَيَّبِ، عَنْ أَبِيهِ، قَالَ لَقَدْ رَأَيْتُ الشَّجَرَةَ ثُمَّ أَتَيْتُهَا بَعْدُ فَلَمْ أَعْرِفْهَا.
Reference : Sahih Muslim 1859c
In-book reference : Book 33, Hadith 117
USC-MSA web (English) reference : Book 20, Hadith 4589
  (deprecated numbering scheme)