ENOfficial
It was narrated from Ibn 'Abbas that 'Umar رضي الله عنه said: I was with the Prophet (ﷺ) on a campaign, and I swore (an oath), No, by my father! A man called out from behind me: “Do not swear by your fathers.” And I saw that it was the Prophet (ﷺ).
Source: sunnah.com
Other translations
Arabic
حَدَّثَنَا مُحَمَّدُ بْنُ عَبْدِ اللَّهِ الزُّبَيْرِيُّ، حَدَّثَنَا إِسْرَائِيلُ، عَنْ سِمَاكٍ، عَنْ عِكْرِمَةَ، عَنِ ابْنِ عَبَّاسٍ، عَنْ عُمَرَ، رَضِيَ اللَّهُ عَنْهُ قَالَ كُنْتُ مَعَ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فِي غَزَاةٍ فَحَلَفْتُ لَا وَأَبِي فَهَتَفَ بِي رَجُلٌ مِنْ خَلْفِي فَقَالَ لَا تَحْلِفُوا بِآبَائِكُمْ فَإِذَا هُوَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ.
sunnah.com