The Messenger of Allah ﷺ heard me swearing an oath by my father and said: “Allah forbids you to swear by your fathers.” ‘Umar said: By Allah, I never swore by my father after that, whether saying it myself or narrating what someone else had said. (Using translation from Aḥmad 241)
أَنَّ رَسُولَ اللهِ ﷺ سَمِعَ عُمَرَ وَهُوَيَقُولُ وَأَبِي وَأَبِي فَقَالَ إِنَّ اللهَ ﷻ يَنْهَاكُمْ أَنْ تَحْلِفُوا بِآبَائِكُمْ قَالَ عُمَرُ فَوَاللهِ فَوَاللهِ مَا حَلَفْتُ بِهَا ذَاكِرًا وَلَا آثِرًا