The Prophet ﷺ said, "If anybody has to take an oath, he should swear only by Allah." The people of Quraish used to swear by their fathers, but the Prophet ﷺ said, "Do not swear by your fathers. " (Using translation from Bukhārī 3836)
عَنِ النَّبِيِّ ﷺ قَالَ مَنْ كَانَ حَالِفًا فَلَا يَحْلِفْ إِلَّا بِاللهِ ﷻ وَكَانَتْ قُرَيْشٌ تَحْلِفُ بِآبَائِهَا فَقَالَ لَا تَحْلِفُوا بِآبَائِكُمْ