The Prophet ﷺ left Medina for Mecca till he reached 'Usfan, He then called for a vessel (of water). It was raised to his mouth to show it to the people, and that was in Ramadan. Ibn 'Abbas used to say: The Prophet ﷺ fasted and he broke his fast. He who likes may fast and he who likes may break.
خَرَجَ النَّبِيُّ ﷺ مِنَ الْمَدِينَةِ إِلَى مَكَّةَ حَتَّى بَلَغَ عُسْفَانَ ثُمَّ دَعَا بِإِنَاءٍ فَرَفَعَهُ إِلَى فِيهِ لِيُرِيَهُ النَّاسَ وَذَلِكَ فِي رَمَضَانَ فَكَانَ ابْنُ عَبَّاسٍ يَقُولُ قَدْ صَامَ النَّبِيُّ ﷺ وَأَفْطَرَ فَمَنْ شَاءَ صَامَ وَمَنْ شَاءَ أَفْطَرَ