Hadith 172

Sahih Bukhari

Book 56: Fighting for the Cause of Allah (Jihaad)

Chapter 110

To give a Bai'a for not to flee during a battle

باب الْبَيْعَةِ فِي الْحَرْبِ أَنْ لاَ يَفِرُّوا

Some said, “(To give the Bai‘a pledge) for death,” according to the Statement of Allah تعالى: “Indeed, Allah was pleased with the believers…” (V.48:18)
وَقَالَ بَعْضُهُمْ عَلَى الْمَوْتِ لِقَوْلِ اللَّهِ تَعَالَى: {لَقَدْ رَضِيَ اللَّهُ عَنِ الْمُؤْمِنِينَ إِذْ يُبَايِعُونَكَ تَحْتَ الشَّجَرَةِ}.
Sahih al-Bukhari 2961
حَدَّثَنَا حَفْصُ بْنُ عُمَرَ، حَدَّثَنَا شُعْبَةُ، عَنْ حُمَيْدٍ، قَالَ سَمِعْتُ أَنَسًا ـ رضى الله عنه ـ يَقُولُ كَانَتِ الأَنْصَارُ يَوْمَ الْخَنْدَقِ تَقُولُ نَحْنُ الَّذِينَ بَايَعُوا مُحَمَّدَا عَلَى الْجِهَادِ مَا حَيِينَا أَبَدَا فَأَجَابَهُمُ النَّبِيُّ صلى الله عليه وسلم فَقَالَ اللَّهُمَّ لاَ عَيْشَ إِلاَّ عَيْشُ الآخِرَهْ فَأَكْرِمِ الأَنْصَارَ وَالْمُهَاجِرَهْ
Anas:

On the day (of the battle) of the Trench, the Ansar were saying, "We are those who have sworn allegiance to Muhammad for Jihaid (for ever) as long as we live." The Prophet (ﷺ) replied to them, "O Allah! There is no life except the life of the Hereafter. So honor the Ansar and emigrants with Your Generosity."