The Messenger of Allah ﷺ used to go to Quba both riding and on foot.
حدثنا عفان حدثنا عبد العزيز بن مسلم أخبرني عبد الله بن دينار
أن رسول الله ﷺ كان يأتي قباء راكبا وماشيا
Its isnad is sahih, and it is a repetition of 5774.