Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:24:53

And they swear by Allah their strongest oaths that if you ordered them, they would go forth ˹in Allah 's cause˺. Say, "Do not swear. ˹Such˺ obedience is known. Indeed, Allah is Acquainted with that which you do."  

And they swear by God solemn oaths that if you order them, to ˹participate in the˺ struggle, they will surely go forth. Say, to them: ‘Do not swear! Acknowledged obedience, to the Prophet is better than the oaths to which you are not true. Surely God is Aware of what you do’, when you say you will obey but act otherwise.
القرآن:٢٤:٥٣

وَأَقْسَمُوا بِاللَّهِ جَهْدَ أَيْمَانِهِمْ لَئِنْ أَمَرْتَهُمْ لَيَخْرُجُنَّ ۖ قُلْ لَا تُقْسِمُوا ۖ طَاعَةٌ مَعْرُوفَةٌ ۚ إِنَّ اللَّهَ خَبِيرٌ بِمَا تَعْمَلُونَ  

{وأقسموا بالله جهد إيمانهم} غايتها {لئن أمرتهم} بالجهاد {ليخرجنَّ قل} لهم {لا تقسموا طاعة معروفة} للنبي خير من قسمكم الذي لا تصدقون فيه {إن الله خبير بما تعلمون} من طاعتكم بالقول ومخالفتكم بالفعل.