Sahih Muslim
Sahih Muslim 1856 h
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 (through a different chain of transmitters) on the authority of Salim b. al-Ja'd who said
I asked Jabir: How many were you on the Day of Hudaibiya? He said: One thousand and four hundred.