I heard ʿUmar saying, "Messenger of Allah ﷺ said to me, 'Allah forbids you to swear by your fathers." ʿUmar said, "By Allah! Since I heard that from the Prophet ﷺ , I have not taken such an oath, neither intentionally, nor by reporting the oath of someone else."
لِي رَسُولُ اللَّهِ ﷺ إِنَّ اللَّهَ يَنْهَاكُمْ أَنْ تَحْلِفُوا بِآبَائِكُمْ قَالَ عُمَرُ فَوَاللَّهِ مَا حَلَفْتُ بِهَا مُنْذُ سَمِعْتُ النَّبِيَّ ﷺ ذَاكِرًا وَلاَ آثِرًا قَالَ مُجَاهِدٌ {أَوْ أَثَرَةٍ مِنْ عِلْمٍ} يَأْثُرُ عِلْمًا