The Messenger of Allah ﷺ came upon Umar bin Khattab while he was in a caravan swearing by his father. The Prophet ﷺ said, "Allah forbids you from swearing by your fathers. Whoever takes an oath, let him swear by Allah or remain silent."
حدثنا ابن نمير حدثنا عبيد الله عن نافع
أدرك رسول الله ﷺ عمر بن الخطاب وهو في ركب وهو يحلف بأبيه فقال النبي ﷺ ألا إن الله ينهاكم أن تحلفوا بآبائكم فليحلف حالف بالله أو ليسكت
Its isnad is sahih. It is a repeat of 4667, see also 6073. His saying, "let him swear," appears in one copy in the margin of M as "so he swears," without the lam of command, though it is retained in his saying, "or let him be silent."