The Messenger of Allah ﷺ set out from Medina toward Mecca and was fasting until he reached Usfan. Then he called for water and raised it up with his hands so the people could see, and he broke his fast. He continued without fasting until he arrived in Mecca, and this was during Ramadan.Ibn Abbas used to say, "The Messenger of Allah ﷺ both fasted and broke his fast on this journey, so whoever wishes may fast, and whoever wishes may break his fast."
حدثنا موسى بن إسماعيل حدثنا أبو عوانة عن منصور عن مجاهد عن طاوس
خرج رسول الله ﷺ من المدينة إلى مكة فصام حتى بلغ عسفان ثم دعا بماء فرفعه إلى يديه ليريه الناس فأفطر حتى قدم مكة وذلك في رمضان فكان ابن عباس يقول قد صام رسول الله ﷺ وأفطر فمن شاء صام ومن شاء أفطر