(110) باب الْبَيْعَةِ فِي الْحَرْبِ أَنْ لاَ يَفِرُّوا
Narrated 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."
Reference: Sahih al-Bukhari 2961
In-book reference: Book 56, Hadith 172
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 4, Book 52, Hadith 208