Abu Hurairah reported,

The Prophet ﷺ, or as Abu Qasim ﷺ said, "If the Ansar were to take a valley or a mountain pass, I would take the valley of the Ansar. Were it not for the Hijrah, I would have been a man from the Ansar."Abu Hurairah said, "He did them no injustice, may my father and mother be sacrificed for him. They sheltered him and supported him," or some similar words.

Bukhari 3779

Sahih

حدثني محمد بن بشار حدثنا غندر حدثنا شعبة عن محمد بن زياد

عن أبي هريرة رضي الله عنه

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

البخاري 3779صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Virtues of the Ansar
Chapter
A saying of the Prophet ﷺ, "If not for the Hijrah, I would have been a man of the Ansar"
Numbering
Darussalam 3779
Bukhari 3779