It was narrated that ʼUmar رضي الله عنه said:
The Messenger of Allah (ﷺ) heard me swearing an oath by my father and said: “Allah forbids you to swear by your fathers.” ‘Umar said: By Allah, I never swore by my father after that, whether saying it myself or narrating what someone else had said.