Malik bin Hamzah (may Allah have mercy on him) narrates from his grandfather Abu Usayd al-Sa'idi (may Allah be pleased with him) that people came to the Prophet (peace and blessings be upon him) to dig the Trench and began pledging allegiance to him (peace and blessings be upon him) on emigration (hijrah). When he (peace and blessings be upon him) had finished, he said: "O company of the Ansar! You do not pledge allegiance on emigration; rather, people will emigrate to you. Whoever meets Allah while loving the Ansar will meet Allah while He loves him, and whoever meets Allah while hating the Ansar will meet Allah while He hates him."
Hadith Referenceالمعجم الكبير للطبراني / باب الميم / 16640