Anas bin Malik reported,

The Messenger of Allah ﷺ went out to the trench and found the Emigrants and the Helpers digging on a cold morning, for they had no servants to do the work for them. When he saw the exhaustion and hunger they were enduring, he said, "O Allah, the true life is the life of the Hereafter, so forgive the Helpers and the Emigrants."They replied to him, "We are the ones who pledged allegiance to Muhammad to strive in jihad as long as we live."

Bukhari 2834

Sahih

حدثنا عبد الله بن محمد حدثنا معاوية بن عمرو حدثنا أبو إسحاق عن حميد قال سمعت

أنسا رضي الله عنه يقول

خرج رسول الله ﷺ إلى الخندق فإذا المهاجرون والأنصار يحفرون في غداة باردة فلم يكن لهم عبيد يعملون ذلك لهم فلما رأى ما بهم من النصب والجوع قال اللهم إن العيش عيش الآخره فاغفر للأنصار والمهاجره فقالوا مجيبين له نحن الذين بايعوا محمدا على الجهاد ما بقينا أبدا

البخاري 2834صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Jihad and expeditions
Chapter
Urging to fight
Numbering
Darussalam 2834
Bukhari 2834