The Prophet ﷺ said, "Whoever swears an oath must swear only by Allah." Quraysh used to swear by their forefathers, so he said, "Do not swear by your forefathers."
حدثنا قتيبة حدثنا إسماعيل بن جعفر عن عبد الله بن دينار
عن النبي ﷺ قال ألا من كان حالفا فلا يحلف إلا بالله فكانت قريش تحلف بآبائها فقال لا تحلفوا بآبائكم