The Messenger of Allah ﷺ said, "Do not swear by the false idols, nor by your fathers."
قال رسول الله ﷺ لا تحلفوا بالطواغي ولا بآبائكم.
Muslim narrated it in the Book of Oaths and Vows (1648) from Abu Bakr bin Abu Shayba, who said, Abdul-Ala narrated to us, from Hisham, from Hasan, from Abdul-Rahman bin Samura, and he mentioned it.