The Prophet ﷺ said, "Hijrah will not cease so long as the enemy is being fought."Muawiya, Abdul-Rahman bin Awf, and Abdullah bin Amr bin As said that the Prophet ﷺ said, "Hijrah is of two kinds. One is that you abandon evil deeds, and the other is that you migrate to Allah and His Messenger. Hijrah will not cease as long as repentance is accepted, and repentance will continue to be accepted until the sun rises from the west. When it rises from there, every heart will be sealed with whatever is in it, and people will be spared the need for further deeds."
حدثنا الحكم بن نافع حدثنا إسماعيل بن عياش عن ضمضم بن زرعة عن شريح بن عبيد يرده إلى مالك بن يخامر
أن النبي ﷺ قال لا تنقطع الهجرة ما دام العدو يقاتل فقال معاوية وعبد الرحمن بن عوف وعبد الله بن عمرو بن العاص إن النبي ﷺ قال إن الهجرة خصلتان إحداهما أن تهجر السيئات والأخرى أن تهاجر إلى الله ورسوله ولا تنقطع الهجرة ما تقبلت التوبة ولا تزال التوبة مقبولة حتى تطلع الشمس من المغرب فإذا طلعت طبع على كل قلب بما فيه وكفي الناس العمل