It was narrated from Salim bin 'Abdullah bin 'Umar, from his father, from 'Umar, that :the Messenger of Allah (ﷺ) heard him swearing by his father. The Messenger of Allah (ﷺ) said: “Allah forbids you from making oaths by your forefathers." 'Umar said: I never took an oath by them (i.e., my forefathers) myself nor narrating such words from anyone else.”"
SahihSahihSahihBook 11 · Hadith 5