The Messenger of Allah ﷺ said, "Were it not for the Hijrah, I would have been a man from the Ansar."
حدثنا بهز حدثنا حماد أخبرنا إسحاق بن عبد الله وثابت
قال رسول الله ﷺ لولا الهجرة لكنت امرأ من الأنصار
Its isnad is sahih, and it was previously mentioned at 12532 in a similar and fuller form.