Sahih al-Bukhari 3796
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
حَدَّثَنَا آدَمُ، حَدَّثَنَا شُعْبَةُ، عَنْ حُمَيْدٍ الطَّوِيلِ، سَمِعْتُ أَنَسَ بْنَ مَالِكٍ ـ رضى الله عنه ـ قَالَ كَانَتِ الأَنْصَارُ يَوْمَ الْخَنْدَقِ تَقُولُ نَحْنُ الَّذِينَ بَايَعُوا مُحَمَّدَا عَلَى الْجِهَادِ مَا حَيِينَا أَبَدَا فَأَجَابَهُمُ اللَّهُمَّ لاَ عَيْشَ إِلاَّ عَيْشُ الآخِرَهْ فَأَكْرِمِ الأَنْصَارَ وَالْمُهَاجِرَهْ
Narrated Anas bin Malik:
On the day of the battle of the Trench (i.e. Ghazwat-ul-Khandaq) the Ansar used to say, "We are those who have given the pledge of allegiance to Muhammad for Jihad (i.e. holy fighting) as long as we live." The Prophet (ﷺ) , replied to them, "O Allah! There is no life except the life of the Hereafter; so please honor the Ansar and the Emigrants."
Full reference and source
Sahih al-Bukhari 3796 In-book : Book 63, Hadith 22 USC-MSA web (English) : Vol. 5, Book 58, Hadith 140 (deprecated)
View source on Sunnah.com (opens in a new tab)