Hadithcore
Mishkat al-Masabih, 3407

He reported God’s Messenger as saying, “God forbids you to swear by your fathers. If anyone swears he must swear by God, or keep silent.” (Bukhari and Muslim.)

وَعَنْهُ أَنَّ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ: «إِنَّ اللَّهَ يَنْهَاكُمْ أَنْ تَحْلِفُوا بِآبَائِكُمْ مَنْ كَانَ حَالِفًا فَلْيَحْلِفْ بِاللَّهِ أَوْ ليصمت»

References1 variant
In-Book Reference
Book 15, Hadith 2