The Messenger of Allah ﷺ said, "Do not swear by the false idols, nor by your fathers."
حدثنا أبو بكر بن أبي شيبة حدثنا عبد الأعلى عن هشام عن الحسن
قال رسول الله ﷺ لا تحلفوا بالطواغي ولا بآبائكم
Muslim narrated it in the chapter, "Whoever swears by Lat and Uzza should say, 'There is no god but Allah,'" in the Book of Oaths, hadith no. 1648, from Abu Bakr bin Abu Shayba, through the same chain.