'Ali bin Rabi'ah reported:
In my presence, a beast was brought to 'Ali bin Abu Talib (May Allah be pleased with him) for riding. When he put his foot in the stirrup, he said: "Bismillah (With the Name of Allah)." When he had settled himself on its back he recited: "Al-hamdu lillahil-ladhi sakh-khara lana hadha, wa ma kunna lahu muqrinin, wa inna ila Rabbina lamunqalibun. (All praise belongs to Allah Who has made this subservient to us, for we had not the strength to overpower it; and to our Rubb shall we return)." He then recited thrice: "Alhamdu lillah (Praise be to Allah)," and then three times: "Allahu Abkar (Allah is Greatest)." Then he said: "Subhanaka inni zalamtu nafsi faghfir li, innahu la yaghfirudh-dhunuba illa Anta (You are far removed from imperfection I have wronged myself, so forgive me, because none but You can forgive sins)." Then he smiled. It was asked: "Why have you smiled, O Amir Al-Mu'minin (Leader of the Believers)?" He replied: "I saw the Messenger of Allah (ﷺ) doing as I have done. I (i.e., Ali) asked him (the Messenger of Allah (ﷺ)) the reason for smiling. He (ﷺ) said, 'Your Rubb, Glorious is He, is pleased when His slave seeks His forgiveness. He (the slave) has firm faith that none except Allah Alone can forgive sins)'."[Abu Dawud and At-Tirmidhi].
App reference: Book 8, Hadith 19
Arabic/English book reference: Book 8, Hadith 974