Sayyiduna Ibn Umar (may Allah be pleased with them both) narrates from Sayyiduna Umar (may Allah be pleased with him) that he said: "No, by my father!" So the Messenger of Allah (peace and blessings be upon him) said: "Stop! For indeed whoever swears by anything other than Allah has committed shirk (associated partners with Allah)."
Imam Ahmad (may Allah have mercy on him) narrated it in this way in "al-Musnad" under "the Musnad of Umar", and he also narrated it in "the Musnad of Abdullah bin Umar".