The Prophet (ﷺ) used to go to the Quba' mosque, sometimes walking, sometimes riding.

Sahih al-Bukhari Book 96 Hadith 56

Sahih al-Bukhari #7326

Holding Fast to the Qur'an and Sunnah 96:56

Narrated Ibn `Umar:

The Prophet (ﷺ) used to go to the Quba' mosque, sometimes walking, sometimes riding.

Chapter: The religious learned men should not differ

Grade: Sahih