(110) باب الْبَيْعَةِ فِي الْحَرْبِ أَنْ لاَ يَفِرُّوا
Narrated Mujashi:
My brother and I came to the Prophet (ﷺ) and I requested him to take the pledge of allegiance from us for migration. He said, "Migration has passed away with its people." I asked, "For what will you take the pledge of allegiance from us then?" He said, "I will take (the pledge) for Islam and Jihad."
Reference: Sahih al-Bukhari 2962, 2963
In-book reference: Book 56, Hadith 173
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 4, Book 52, Hadith 208